<!DOCTYPE html>
<!--
Copyright 2016 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/base/multi_dimensional_view.html">
<link rel="import" href="/tracing/base/utils.html">
<link rel="import" href="/tracing/core/test_utils.html">

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  const MultiDimensionalViewBuilder = tr.b.MultiDimensionalViewBuilder;
  const MultiDimensionalViewNode = tr.b.MultiDimensionalViewNode;
  const ViewType = MultiDimensionalViewBuilder.ViewType;
  const SELF = MultiDimensionalViewBuilder.ValueKind.SELF;
  const TOTAL = MultiDimensionalViewBuilder.ValueKind.TOTAL;
  const NOT_PROVIDED = MultiDimensionalViewNode.TotalState.NOT_PROVIDED;
  const LOWER_BOUND = MultiDimensionalViewNode.TotalState.LOWER_BOUND;
  const EXACT = MultiDimensionalViewNode.TotalState.EXACT;
  const RecursionDepthTracker = tr.b.RecursionDepthTracker;
  const zFunction = tr.b.zFunction;

  function assertListStrictEqual(a, b) {
    assert.lengthOf(a, b.length);
    for (let i = 0; i < a.length; i++) {
      assert.strictEqual(a[i], b[i]);
    }
  }

  function checkTree(actualTreeRootNode, expectedStructureRootNode) {
    // Build map from expected structure node IDs to expected structure nodes.
    const expectedStructureNodesById = new Map();
    addExpectedStructureToMap(
        expectedStructureRootNode, expectedStructureNodesById);

    // Recursively check the structure of the actual tree.
    const actualTreeNodesById = new Map();
    checkTreeStructure(actualTreeRootNode, expectedStructureRootNode,
        actualTreeNodesById, expectedStructureNodesById);

    // Test sanity check.
    assert.strictEqual(
        actualTreeNodesById.size, expectedStructureNodesById.size);
  }

  function addExpectedStructureToMap(expectedStructureNode, map) {
    if (typeof expectedStructureNode === 'string') {
      return;  // Reference to another expected structure node.
    }

    const expectedStructureNodeId = expectedStructureNode.id;
    if (expectedStructureNodeId !== undefined) {
      assert.isFalse(map.has(expectedStructureNodeId));
      map.set(expectedStructureNodeId, expectedStructureNode);
    }

    const expectedStructureChildren = expectedStructureNode.children;
    for (let d = 0; d < expectedStructureChildren.length; d++) {
      const expectedStructureDimensionChildren = expectedStructureChildren[d];
      for (let i = 0; i < expectedStructureDimensionChildren.length; i++) {
        addExpectedStructureToMap(expectedStructureDimensionChildren[i], map);
      }
    }
  }

  function checkTreeStructure(actualTreeNode, expectedStructureNode,
      actualTreeNodesById, expectedStructureNodesById) {
    // Check the multi-dimensional title.
    assert.deepEqual(
        Array.from(actualTreeNode.title), expectedStructureNode.title);

    // Check the values.
    assert.deepEqual(actualTreeNode.values, expectedStructureNode.values);

    // Check the children.
    const expectedStructureChildNodes = expectedStructureNode.children;
    const actualTreeChildNodes = actualTreeNode.children;
    assert.lengthOf(actualTreeChildNodes, expectedStructureChildNodes.length);

    for (let d = 0; d < expectedStructureChildNodes.length; d++) {
      const expectedStructureDimensionChildNodes =
        expectedStructureChildNodes[d];
      const actualTreeDimensionChildNodes = actualTreeChildNodes[d];
      assert.strictEqual(actualTreeDimensionChildNodes.size,
          expectedStructureDimensionChildNodes.length);

      const expectedStructureDimensionChildNodeTitles = new Set();

      for (let i = 0; i < expectedStructureDimensionChildNodes.length; i++) {
        let expectedStructureDimensionChildNode =
            expectedStructureDimensionChildNodes[i];
        let isReference = false;

        // If the expected structure child node is a reference to another
        // expected structure node, resolve it.
        if (typeof expectedStructureDimensionChildNode === 'string') {
          expectedStructureDimensionChildNode = expectedStructureNodesById.get(
              expectedStructureDimensionChildNode);
          assert.isDefined(expectedStructureDimensionChildNode);
          isReference = true;
        }

        // Check that the expected structure doesn't contain two children with
        // the same title.
        const childTitle = expectedStructureDimensionChildNode.title[d];
        assert.isFalse(
            expectedStructureDimensionChildNodeTitles.has(childTitle));
        expectedStructureDimensionChildNodeTitles.add(childTitle);

        // Get the associated child node of the actual tree.
        const actualTreeDimensionChildNode =
            actualTreeDimensionChildNodes.get(childTitle);
        assert.isDefined(actualTreeDimensionChildNode);

        // Check that all expected structure nodes with the same ID correspond
        // to the same actual tree node.
        const childId = expectedStructureDimensionChildNode.id;
        if (childId !== undefined) {
          if (actualTreeNodesById.has(childId)) {
            assert.strictEqual(actualTreeDimensionChildNode,
                actualTreeNodesById.get(childId));
          } else {
            actualTreeNodesById.set(childId, actualTreeDimensionChildNode);
          }
        }

        // Recursively check the structure of the actual tree child node
        // (unless the expected structure child node was a reference).
        if (!isReference) {
          checkTreeStructure(actualTreeDimensionChildNode,
              expectedStructureDimensionChildNode, actualTreeNodesById,
              expectedStructureNodesById);
        }
      }

      // Test sanity check (all child titles should be unique).
      assert.strictEqual(expectedStructureDimensionChildNodeTitles.size,
          expectedStructureDimensionChildNodes.length);
    }
  }

  function createBuilderWithEntries(dimensions, valueCount, pathEntries) {
    const builder = new MultiDimensionalViewBuilder(dimensions, valueCount);
    pathEntries.forEach(function(pathEntry) {
      builder.addPath(pathEntry.path, pathEntry.values, pathEntry.kind);
    });
    return builder;
  }

  function builderTest(testName, dimensions, valueCount, setComplete,
      pathEntries, expectedTopDownTreeViewStructure,
      expectedTopDownHeavyViewStructure, expectedBottomUpHeavyViewStructure) {
    test('builder_' + testName, function() {
      // Create a multi-dimensional tree builder and add all paths to it.
      const builder =
          createBuilderWithEntries(dimensions, valueCount, pathEntries);
      builder.complete = setComplete;

      // Build and check the views.
      checkTree(
          builder.buildView(ViewType.TOP_DOWN_TREE_VIEW),
          expectedTopDownTreeViewStructure);
      checkTree(
          builder.buildView(ViewType.TOP_DOWN_HEAVY_VIEW),
          expectedTopDownHeavyViewStructure);
      checkTree(
          builder.buildView(ViewType.BOTTOM_UP_HEAVY_VIEW),
          expectedBottomUpHeavyViewStructure);
    });
  }

  /**
   * Calculate the sum of binary powers.
   *
   * Each exponent can either be (1) a single number corresponding to a single
   * power of two (2**exponent), or (2) a two-element list for a sum over a
   * range of exponents (2**exponent[0] + 2**(exponent[0] + 1) + ... +
   * 2**exponent[1]).
   */
  function b(/* exponent1, ..., exponentN */) {
    let sum = 0;
    for (let i = 0; i < arguments.length; i++) {
      const exponent = arguments[i];
      if (typeof exponent === 'number') {
        sum += 1 << arguments[i];
      } else {
        assert.lengthOf(exponent, 2);  // Test sanity check.
        // We use the fact that 2**A + 2**(A + 1) ... + 2**B =
        // (2**0 + 2**1 + ... 2**B) - (2**0 + 2**1 + ... + 2**(A - 1)) =
        // (2**(B + 1) - 1) - (2**A - 1) = 2**(B + 1) - 2**A.
        sum += (1 << (exponent[1] + 1)) - (1 << exponent[0]);
      }
    }
    return sum;
  }

  function checkZFunction(list, expectedResult) {
    if (typeof list === 'string') {
      assert.deepEqual(zFunction(list, 0), expectedResult);
      assert.deepEqual(zFunction(list[0] + list, 1), expectedResult);
      assert.deepEqual(zFunction(list + list, list.length), expectedResult);
    } else {
      assert.deepEqual(zFunction([].concat(list), 0), expectedResult);
      assert.deepEqual(zFunction([list[0]].concat(list), 1), expectedResult);
      assert.deepEqual(
          zFunction(list.concat(list), list.length), expectedResult);
    }
  }

  /**
   * Helper function for generating builder tests. Given a number of dimensions
   * and a list of path entries, this function generates the source code of
   * the corresponding builder test with expected top-down tree view, top-down
   * heavy view and bottom-up heavy view structures.
   *
   * This avoids the need to write such tests manually, which is very tedious.
   * However, the correctness of the generated structures needs to be verified
   * by the developer! Maximum line length must also be enforced manually.
   */
  function generateBuilderTest(
      targetTestName, dimensions, valueCount, pathEntries) {
    test('builderTestGenerator_' + targetTestName, function() {
      // Create the builder.
      const builder =
          createBuilderWithEntries(dimensions, valueCount, pathEntries);

      // Generate the test case source code.
      const generator = new tr.c.TestUtils.SourceGenerator();
      generator.indentBlock(2, false /* don't break line */, function() {
        // Test name and number of dimensions (first line).
        generator.push('builderTest(\'', targetTestName, '\', ',
            String(dimensions), ' /* dimensions */, ',
            String(valueCount), ' /* valueCount */,');

        generator.indentBlock(4, true /* break line */, function() {
          // Path entries.
          generator.formatMultiLineList(pathEntries, function(pathEntry) {
            generator.push('{ path: ');
            generator.formatSingleLineList(
                pathEntry.path,
                function(singleDimensionPath) {
                  generator.formatSingleLineList(
                      singleDimensionPath, generator.formatString, generator);
                });
            generator.push(', values: ');
            generator.formatSingleLineList(
                pathEntry.values,
                function(value) {
                  generator.push(String(value));
                });
            const kind = pathEntry.kind === SELF ? 'SELF' : 'TOTAL';
            generator.push(', kind: ', kind, ' }');
          });
          generator.push(',');
          generator.breakLine();

          function formatExpectedTreeStructure(root, label) {
            let nextNodeId = 0;
            const nodeInfos = new WeakMap();

            function assignNodeIdsToRepeatedNodes(node) {
              if (nodeInfos.has(node)) {
                // We have already visited the node (one or more times), so
                // there is no need to visit its children.
                if (nodeInfos.get(node) === undefined) {
                  // This is the second time we visited the node: Change the
                  // undefined entry to a defined node info entry.
                  nodeInfos.set(node, { id: undefined });
                }
                return;
              }

              // This is the first time we visited the node: Add an undefined
              // entry to the node info map and recursively visit all its
              // children.
              nodeInfos.set(node, undefined);
              node.children.forEach(function(singleDimensionChildren) {
                for (const child of singleDimensionChildren.values()) {
                  assignNodeIdsToRepeatedNodes(child);
                }
              });
            }
            assignNodeIdsToRepeatedNodes(root);

            // Track the multi-dimensional path to the current node to generate
            // comments.
            const paths = new Array(dimensions);
            for (let i = 0; i < paths.length; i++) {
              paths[i] = [];
            }
            function withChild(childNode, dimension, callback) {
              paths[dimension].push(childNode.title[dimension]);
              callback();
              paths[dimension].pop();
            }
            function appendPathComment(opt_label) {
              if (opt_label) {
                generator.pushComment(opt_label);
                return;
              }

              paths.forEach(function(dimensionPath, dimensionIndex) {
                if (dimensionIndex > 0) {
                  generator.pushComment(', ');
                }
                if (dimensionPath.length === 0) {
                  generator.pushComment('*');
                  return;
                }
                dimensionPath.forEach(function(ancestorTitle, ancestorIndex) {
                  if (ancestorIndex > 0) {
                    generator.pushComment(' -> ');
                  }
                  generator.pushComment(ancestorTitle);
                });
              });
            }

            function formatExpectedTreeStructureRecursively(node, opt_label) {
              let nodeId = undefined;
              const nodeInfo = nodeInfos.get(node);
              if (nodeInfo !== undefined) {
                // This node is referenced multiple times in the expected tree
                // structure.
                nodeId = nodeInfo.id;
                if (nodeId === undefined) {
                  // This is the first time we visited the node: Assign it a
                  // unique node id and then format it and its descendants
                  // recursively.
                  nodeId = '#' + (nextNodeId++);
                  nodeInfo.id = nodeId;
                } else {
                  // We have already visited this node: Just insert the node's
                  // id (instead of formatting it and its descendants
                  // recursively again).
                  generator.push('\'', nodeId, '\'');
                  appendPathComment();
                  return;
                }
              }

              generator.push('{');
              appendPathComment(opt_label);

              generator.indentBlock(2, true /* break line */, function() {
                // Node id (if defined).
                if (nodeId !== undefined) {
                  generator.push('id: \'', nodeId, '\',');
                  generator.breakLine();
                }

                // Node title.
                generator.push('title: ');
                generator.formatSingleLineList(
                    node.title, generator.formatString, generator);
                generator.push(',');
                generator.breakLine();

                // Node values.
                generator.push('values: ');
                generator.formatMultiLineList(
                    node.values,
                    function(value) {
                      generator.push('{');
                      generator.indentBlock(2, true /* break line */,
                          function() {
                            generator.push('total: ', String(value.total), ',');
                            generator.breakLine();
                            generator.push('self: ', String(value.self), ',');
                            generator.breakLine();
                            generator.push('totalState: ');

                            let totalStateName;
                            for (const [name, state] of Object.entries(
                                MultiDimensionalViewNode.TotalState)) {
                              if (state === value.totalState) {
                                totalStateName = name;
                                break;
                              }
                            }
                            if (totalStateName === undefined) {
                              throw new Error(
                                  'Unknown total state: ' + value.totalState);
                            }
                            generator.push(totalStateName);
                            generator.breakLine();
                          });
                      generator.push('}');
                    });
                generator.push(',');
                generator.breakLine();

                // Node children.
                const children = node.children;
                generator.push('children: ');
                generator.formatMultiLineList(
                    children,
                    function(singleDimensionChildren, dimension) {
                      generator.formatMultiLineList(
                          Array.from(singleDimensionChildren.values()),
                          function(child, childIndex) {
                            withChild(child, dimension, function() {
                              formatExpectedTreeStructureRecursively(child);
                            });
                          });
                    });
              });
              generator.breakLine();
              generator.push('}');
            }

            formatExpectedTreeStructureRecursively(root, label);
          }

          // Build and format the three multi-dimensional views.
          formatExpectedTreeStructure(
              builder.buildTopDownTreeView(), 'Top-down tree view');
          generator.push(',');
          generator.breakLine();
          formatExpectedTreeStructure(
              builder.buildTopDownHeavyView(), 'Top-down heavy view');
          generator.push(',');
          generator.breakLine();
          formatExpectedTreeStructure(
              builder.buildBottomUpHeavyView(), 'Bottom-up heavy view');
          generator.push(');');
        });
      });

      tr.c.TestUtils.addSourceListing(this, generator.build());

      throw new Error('This error is thrown to prevent accidentally ' +
          'checking in a test generator instead of an actual test.');
    });
  }

  builderTest('zeroDimensions_noPaths', 0 /* dimensions */, 1 /* valueCount */,
      false /* setComplete */,
      [],
      {  // Top-down tree view.
        title: [],
        values: [
          {
            total: 0,
            self: 0,
            totalState: NOT_PROVIDED
          }
        ],
        children: []
      },
      {  // Top-down heavy view.
        title: [],
        values: [
          {
            total: 0,
            self: 0,
            totalState: NOT_PROVIDED
          }
        ],
        children: []
      },
      {  // Bottom-up heavy view.
        title: [],
        values: [
          {
            total: 0,
            self: 0,
            totalState: NOT_PROVIDED
          }
        ],
        children: []
      });

  builderTest('zeroDimensions_withPaths', 0 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [], values: [2], kind: SELF },
        { path: [], values: [3], kind: TOTAL },
        { path: [], values: [4], kind: SELF },
        { path: [], values: [5], kind: TOTAL }
      ],
      {  // Top-down tree view.
        title: [],
        values: [
          {
            total: 8,
            self: 6,
            totalState: EXACT
          }
        ],
        children: []
      },
      {  // Top-down heavy view.
        title: [],
        values: [
          {
            total: 8,
            self: 6,
            totalState: EXACT
          }
        ],
        children: []
      },
      {  // Bottom-up heavy view.
        title: [],
        values: [
          {
            total: 8,
            self: 6,
            totalState: EXACT
          }
        ],
        children: []
      });

  builderTest('oneDimension_noPaths', 1 /* dimensions */, 1 /* valueCount */,
      false /* setComplete */,
      [],
      {  // Top-down tree view.
        title: [undefined],
        values: [
          {
            total: 0,
            self: 0,
            totalState: NOT_PROVIDED
          }
        ],
        children: [
          []
        ]
      },
      {  // Top-down heavy view.
        title: [undefined],
        values: [
          {
            total: 0,
            self: 0,
            totalState: NOT_PROVIDED
          }
        ],
        children: [
          []
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined],
        values: [
          {
            total: 0,
            self: 0,
            totalState: NOT_PROVIDED
          }
        ],
        children: [
          []
        ]
      });

  builderTest('oneDimension_zeroLengthPath', 1 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [[]], values: [42], kind: SELF }
      ],
      {  // Top-down tree view.
        title: [undefined],
        values: [
          {
            total: 42,
            self: 42,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          []
        ]
      },
      {  // Top-down heavy view.
        title: [undefined],
        values: [
          {
            total: 42,
            self: 42,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          []
        ]
      },
      {  // Top-down heavy view.
        title: [undefined],
        values: [
          {
            total: 42,
            self: 42,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          []
        ]
      });

  builderTest('oneDimension_noRecursion', 1 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['A', 'B', 'C']], values: [10], kind: SELF },
        { path: [['A', 'B']], values: [20], kind: SELF },
        { path: [['B', 'D']], values: [30], kind: SELF },
        { path: [['A', 'B', 'D']], values: [40], kind: SELF },
        { path: [['A', 'C']], values: [50], kind: SELF },
        { path: [[]], values: [60], kind: SELF }
      ],
      {  // Top-down tree view.
        title: [undefined],
        values: [
          {
            total: 210,
            self: 60,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 120,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 70,
                        self: 20,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 10,
                              self: 10,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        },
                        {  // A -> B -> D.
                          title: ['D'],
                          values: [
                            {
                              total: 40,
                              self: 40,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 50,
                        self: 50,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 30,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> D.
                    title: ['D'],
                    values: [
                      {
                        total: 30,
                        self: 30,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined],
        values: [
          {
            total: 210,
            self: 60,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 120,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 70,
                        self: 20,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 10,
                              self: 10,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        },
                        {  // A -> B -> D.
                          title: ['D'],
                          values: [
                            {
                              total: 40,
                              self: 40,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 50,
                        self: 50,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 100,
                  self: 20,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 10,
                        self: 10,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  },
                  {  // B -> D.
                    title: ['D'],
                    values: [
                      {
                        total: 70,
                        self: 70,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 60,
                  self: 60,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                []
              ]
            },
            {  // D.
              title: ['D'],
              values: [
                {
                  total: 70,
                  self: 70,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined],
        values: [
          {
            total: 210,
            self: 60,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 120,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                []
              ]
            },
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 100,
                  self: 20,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 70,
                        self: 20,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 60,
                  self: 60,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // C -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 10,
                        self: 10,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // C -> B -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 10,
                              self: 10,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // C -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 50,
                        self: 50,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // D.
              title: ['D'],
              values: [
                {
                  total: 70,
                  self: 70,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // D -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 70,
                        self: 70,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // D -> B -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 40,
                              self: 40,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      });

  builderTest('oneDimension_simpleRecursion', 1 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['A']], values: [10], kind: SELF },
        { path: [['A', 'A', 'A']], values: [20], kind: SELF },
        { path: [['A', 'A']], values: [30], kind: SELF },
        { path: [['A', 'A', 'A', 'A']], values: [40], kind: SELF }
      ],
      {  // Top-down tree view.
        title: [undefined],
        values: [
          {
            total: 100,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 100,
                  self: 10,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 90,
                        self: 30,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> A -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 60,
                              self: 20,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // A -> A -> A -> A.
                                title: ['A'],
                                values: [
                                  {
                                    total: 40,
                                    self: 40,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined],
        values: [
          {
            total: 100,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 100,
                  self: 100,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 90,
                        self: 90,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> A -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 60,
                              self: 60,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // A -> A -> A -> A.
                                title: ['A'],
                                values: [
                                  {
                                    total: 40,
                                    self: 40,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined],
        values: [
          {
            total: 100,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 100,
                  self: 100,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 90,
                        self: 90,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> A -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 60,
                              self: 60,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // A -> A -> A -> A.
                                title: ['A'],
                                values: [
                                  {
                                    total: 40,
                                    self: 40,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      });

  builderTest('oneDimension_complexRecursion', 1 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['A', 'B', 'C']], values: [10], kind: SELF },
        { path: [['A', 'D', 'B', 'C', 'A', 'B', 'C']], values: [20],
          kind: SELF },
        { path: [['A', 'D', 'B', 'C', 'A', 'B', 'D']], values: [30],
          kind: SELF },
        { path: [['C', 'B', 'C']], values: [40], kind: SELF },
        { path: [['C', 'B', 'C', 'B', 'C']], values: [50], kind: SELF }
      ],
      {  // Top-down tree view.
        title: [undefined],
        values: [
          {
            total: 150,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 60,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 10,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 10,
                              self: 10,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A -> D.
                    title: ['D'],
                    values: [
                      {
                        total: 50,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> D -> B.
                          title: ['B'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // A -> D -> B -> C.
                                title: ['C'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // A -> D -> B -> C -> A.
                                      title: ['A'],
                                      values: [
                                        {
                                          total: 50,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          {  // A -> D -> B -> C -> A -> B.
                                            title: ['B'],
                                            values: [
                                              {
                                                total: 50,
                                                self: 0,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [
                                                {  // A -> D -> B -> C -> A ->
                                                  // B -> C.
                                                  title: ['C'],
                                                  values: [
                                                    {
                                                      total: 20,
                                                      self: 20,
                                                      totalState: LOWER_BOUND
                                                    }
                                                  ],
                                                  children: [
                                                    []
                                                  ]
                                                },
                                                {  // A -> D -> B -> C -> A ->
                                                  // B -> D.
                                                  title: ['D'],
                                                  values: [
                                                    {
                                                      total: 30,
                                                      self: 30,
                                                      totalState: LOWER_BOUND
                                                    }
                                                  ],
                                                  children: [
                                                    []
                                                  ]
                                                }
                                              ]
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 90,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // C -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 90,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // C -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 90,
                              self: 40,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // C -> B -> C -> B.
                                title: ['B'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // C -> B -> C -> B -> C.
                                      title: ['C'],
                                      values: [
                                        {
                                          total: 50,
                                          self: 50,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined],
        values: [
          {
            total: 150,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 60,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 60,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 30,
                              self: 30,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        },
                        {  // A -> B -> D.
                          title: ['D'],
                          values: [
                            {
                              total: 30,
                              self: 30,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A -> D.
                    title: ['D'],
                    values: [
                      {
                        total: 50,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> D -> B.
                          title: ['B'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // A -> D -> B -> C.
                                title: ['C'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // A -> D -> B -> C -> A.
                                      title: ['A'],
                                      values: [
                                        {
                                          total: 50,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          {  // A -> D -> B -> C -> A -> B.
                                            title: ['B'],
                                            values: [
                                              {
                                                total: 50,
                                                self: 0,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [
                                                {  // A -> D -> B -> C -> A ->
                                                  // B -> C.
                                                  title: ['C'],
                                                  values: [
                                                    {
                                                      total: 20,
                                                      self: 20,
                                                      totalState: LOWER_BOUND
                                                    }
                                                  ],
                                                  children: [
                                                    []
                                                  ]
                                                },
                                                {  // A -> D -> B -> C -> A ->
                                                  // B -> D.
                                                  title: ['D'],
                                                  values: [
                                                    {
                                                      total: 30,
                                                      self: 30,
                                                      totalState: LOWER_BOUND
                                                    }
                                                  ],
                                                  children: [
                                                    []
                                                  ]
                                                }
                                              ]
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 150,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 150,
                        self: 120,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // B -> C -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // B -> C -> A -> B.
                                title: ['B'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // B -> C -> A -> B -> C.
                                      title: ['C'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 20,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        []
                                      ]
                                    },
                                    {  // B -> C -> A -> B -> D.
                                      title: ['D'],
                                      values: [
                                        {
                                          total: 30,
                                          self: 30,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        },
                        {  // B -> C -> B.
                          title: ['B'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // B -> C -> B -> C.
                                title: ['C'],
                                values: [
                                  {
                                    total: 50,
                                    self: 50,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B -> D.
                    title: ['D'],
                    values: [
                      {
                        total: 30,
                        self: 30,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 150,
                  self: 120,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // C -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 50,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // C -> A -> B.
                          title: ['B'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // C -> A -> B -> C.
                                title: ['C'],
                                values: [
                                  {
                                    total: 20,
                                    self: 20,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  []
                                ]
                              },
                              {  // C -> A -> B -> D.
                                title: ['D'],
                                values: [
                                  {
                                    total: 30,
                                    self: 30,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // C -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 90,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // C -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 90,
                              self: 90,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // C -> B -> C -> B.
                                title: ['B'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // C -> B -> C -> B -> C.
                                      title: ['C'],
                                      values: [
                                        {
                                          total: 50,
                                          self: 50,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // D.
              title: ['D'],
              values: [
                {
                  total: 50,
                  self: 30,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // D -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 50,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // D -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // D -> B -> C -> A.
                                title: ['A'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // D -> B -> C -> A -> B.
                                      title: ['B'],
                                      values: [
                                        {
                                          total: 50,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          {  // D -> B -> C -> A -> B -> C.
                                            title: ['C'],
                                            values: [
                                              {
                                                total: 20,
                                                self: 20,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              []
                                            ]
                                          },
                                          {  // D -> B -> C -> A -> B -> D.
                                            title: ['D'],
                                            values: [
                                              {
                                                total: 30,
                                                self: 30,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined],
        values: [
          {
            total: 150,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 60,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 50,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> C -> B.
                          title: ['B'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // A -> C -> B -> D.
                                title: ['D'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // A -> C -> B -> D -> A.
                                      title: ['A'],
                                      values: [
                                        {
                                          total: 50,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 150,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 60,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // B -> A -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // B -> A -> C -> B.
                                title: ['B'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // B -> A -> C -> B -> D.
                                      title: ['D'],
                                      values: [
                                        {
                                          total: 50,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          {  // B -> A -> C -> B -> D -> A.
                                            title: ['A'],
                                            values: [
                                              {
                                                total: 50,
                                                self: 0,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B -> D.
                    title: ['D'],
                    values: [
                      {
                        total: 50,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // B -> D -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 90,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // B -> C -> B.
                          title: ['B'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // B -> C -> B -> C.
                                title: ['C'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 150,
                  self: 120,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // C -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 150,
                        self: 120,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // C -> B -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 30,
                              self: 30,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // C -> B -> A -> C.
                                title: ['C'],
                                values: [
                                  {
                                    total: 20,
                                    self: 20,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // C -> B -> A -> C -> B.
                                      title: ['B'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 20,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          {  // C -> B -> A -> C -> B -> D.
                                            title: ['D'],
                                            values: [
                                              {
                                                total: 20,
                                                self: 20,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [
                                                {  // C -> B -> A -> C -> B ->
                                                  // D -> A.
                                                  title: ['A'],
                                                  values: [
                                                    {
                                                      total: 20,
                                                      self: 20,
                                                      totalState: LOWER_BOUND
                                                    }
                                                  ],
                                                  children: [
                                                    []
                                                  ]
                                                }
                                              ]
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        },
                        {  // C -> B -> D.
                          title: ['D'],
                          values: [
                            {
                              total: 50,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // C -> B -> D -> A.
                                title: ['A'],
                                values: [
                                  {
                                    total: 50,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // C -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 90,
                              self: 90,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // C -> B -> C -> B.
                                title: ['B'],
                                values: [
                                  {
                                    total: 50,
                                    self: 50,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // C -> B -> C -> B -> C.
                                      title: ['C'],
                                      values: [
                                        {
                                          total: 50,
                                          self: 50,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // D.
              title: ['D'],
              values: [
                {
                  total: 50,
                  self: 30,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // D -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 50,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  },
                  {  // D -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 30,
                        self: 30,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // D -> B -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 30,
                              self: 30,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              {  // D -> B -> A -> C.
                                title: ['C'],
                                values: [
                                  {
                                    total: 30,
                                    self: 30,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    {  // D -> B -> A -> C -> B.
                                      title: ['B'],
                                      values: [
                                        {
                                          total: 30,
                                          self: 30,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          {  // D -> B -> A -> C -> B -> D.
                                            title: ['D'],
                                            values: [
                                              {
                                                total: 30,
                                                self: 30,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [
                                                {  // D -> B -> A -> C -> B ->
                                                  // D -> A.
                                                  title: ['A'],
                                                  values: [
                                                    {
                                                      total: 30,
                                                      self: 30,
                                                      totalState: LOWER_BOUND
                                                    }
                                                  ],
                                                  children: [
                                                    []
                                                  ]
                                                }
                                              ]
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      });

  builderTest('oneDimension_withTotalSizes', 1 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['B', 'C']], values: [10], kind: TOTAL },
        { path: [['B', 'C', 'D']], values: [5], kind: TOTAL },
        { path: [['B']], values: [15], kind: SELF },
        { path: [['B']], values: [20], kind: TOTAL },
        { path: [['B', 'D']], values: [40], kind: SELF },
        { path: [['C']], values: [50], kind: TOTAL }
      ],
      {  // Top-down tree view.
        title: [undefined],
        values: [
          {
            total: 115,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 65,
                  self: 15,
                  totalState: EXACT
                }
              ],
              children: [
                [
                  {  // B -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 10,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [
                        {  // B -> C -> D.
                          title: ['D'],
                          values: [
                            {
                              total: 5,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B -> D.
                    title: ['D'],
                    values: [
                      {
                        total: 40,
                        self: 40,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 50,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                []
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined],
        values: [
          {
            total: 115,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 65,
                  self: 15,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 10,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // B -> C -> D.
                          title: ['D'],
                          values: [
                            {
                              total: 5,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B -> D.
                    title: ['D'],
                    values: [
                      {
                        total: 40,
                        self: 40,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 60,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // C -> D.
                    title: ['D'],
                    values: [
                      {
                        total: 5,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // D.
              title: ['D'],
              values: [
                {
                  total: 45,
                  self: 40,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined],
        values: [
          {
            total: 115,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 65,
                  self: 15,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                []
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 60,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // C -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 10,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // D.
              title: ['D'],
              values: [
                {
                  total: 45,
                  self: 40,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // D -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 5,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // D -> C -> B.
                          title: ['B'],
                          values: [
                            {
                              total: 5,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // D -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 40,
                        self: 40,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      });

  builderTest('oneDimension_protoTitle', 1 /* dimensions */, 1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['__proto__']], values: [45], kind: SELF },
        { path: [['A']], values: [18], kind: SELF },
        { path: [['A', '__proto__']], values: [89], kind: TOTAL }
      ],
      {  // Top-down tree view.
        title: [undefined],
        values: [
          {
            total: 152,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // __proto__.
              title: ['__proto__'],
              values: [
                {
                  total: 45,
                  self: 45,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                []
              ]
            },
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 107,
                  self: 18,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> __proto__.
                    title: ['__proto__'],
                    values: [
                      {
                        total: 89,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined],
        values: [
          {
            total: 152,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // __proto__.
              title: ['__proto__'],
              values: [
                {
                  total: 134,
                  self: 45,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                []
              ]
            },
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 107,
                  self: 18,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> __proto__.
                    title: ['__proto__'],
                    values: [
                      {
                        total: 89,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined],
        values: [
          {
            total: 152,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // __proto__.
              title: ['__proto__'],
              values: [
                {
                  total: 134,
                  self: 45,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // __proto__ -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 89,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 107,
                  self: 18,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                []
              ]
            }
          ]
        ]
      });

  // See tracing/tracing/base/multi_dimensional_view.html
  // (MultiDimensionalViewBuilder.addDimensionToTopDownHeavyViewNode_ and
  // MultiDimensionalViewBuilder.addDimensionToBottomUpHeavyViewNode_
  // documentation).
  builderTest('oneDimension_documentationExample', 1 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['A']], values: [10], kind: SELF },
        { path: [['A']], values: [30], kind: TOTAL },
        { path: [['A', 'B']], values: [1], kind: SELF },
        { path: [['A', 'B', 'A']], values: [3], kind: SELF },
        { path: [['A', 'B', 'A']], values: [8], kind: TOTAL },
        { path: [['A', 'B', 'C']], values: [2], kind: SELF },
        { path: [['A', 'B', 'C']], values: [7], kind: TOTAL },
        { path: [['B']], values: [12], kind: SELF },
        { path: [['B']], values: [18], kind: TOTAL }
      ],
      {  // Top-down tree view.
        title: [undefined],
        values: [
          {
            total: 48,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 30,
                  self: 10,
                  totalState: EXACT
                }
              ],
              children: [
                [
                  {  // A -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 16,
                        self: 1,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 8,
                              self: 3,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            []
                          ]
                        },
                        {  // A -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 7,
                              self: 2,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 18,
                  self: 12,
                  totalState: EXACT
                }
              ],
              children: [
                []
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined],
        values: [
          {
            total: 48,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 30,
                  self: 13,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 16,
                        self: 1,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 8,
                              self: 3,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        },
                        {  // A -> B -> C.
                          title: ['C'],
                          values: [
                            {
                              total: 7,
                              self: 2,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 34,
                  self: 13,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 8,
                        self: 3,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  },
                  {  // B -> C.
                    title: ['C'],
                    values: [
                      {
                        total: 7,
                        self: 2,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 7,
                  self: 2,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined],
        values: [
          {
            total: 48,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A.
              title: ['A'],
              values: [
                {
                  total: 30,
                  self: 13,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 8,
                        self: 3,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 8,
                              self: 3,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // B.
              title: ['B'],
              values: [
                {
                  total: 34,
                  self: 13,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A.
                    title: ['A'],
                    values: [
                      {
                        total: 16,
                        self: 1,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      []
                    ]
                  }
                ]
              ]
            },
            {  // C.
              title: ['C'],
              values: [
                {
                  total: 7,
                  self: 2,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // C -> B.
                    title: ['B'],
                    values: [
                      {
                        total: 7,
                        self: 2,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // C -> B -> A.
                          title: ['A'],
                          values: [
                            {
                              total: 7,
                              self: 2,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      });

  builderTest('twoDimensions_noPaths', 2 /* dimensions */, 1 /* valueCount */,
      false /* setComplete */,
      [],
      {  // Top-down tree view.
        title: [undefined, undefined],
        values: [
          {
            total: 0,
            self: 0,
            totalState: NOT_PROVIDED
          }
        ],
        children: [
          [],
          []
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 0,
            self: 0,
            totalState: NOT_PROVIDED
          }
        ],
        children: [
          [],
          []
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 0,
            self: 0,
            totalState: NOT_PROVIDED
          }
        ],
        children: [
          [],
          []
        ]
      });

  // See tracing/tracing/base/multi_dimensional_view.html
  // (MultiDimensionalViewNode.finalizeTotalValues_ documentation).
  builderTest('twoDimensions_totalCalculation', 2 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [[], []], values: [10], kind: SELF },
        { path: [['A'], []], values: [21], kind: SELF },
        { path: [['A'], []], values: [30], kind: TOTAL },
        { path: [['B'], []], values: [25], kind: SELF },
        { path: [['B'], []], values: [32], kind: TOTAL },
        { path: [[], ['1']], values: [3], kind: SELF },
        { path: [[], ['1']], values: [15], kind: TOTAL },
        { path: [[], ['2']], values: [40], kind: SELF },
        { path: [[], ['2']], values: [41], kind: TOTAL }
      ],
      {  // Top-down tree view.
        title: [undefined, undefined],
        values: [
          {
            total: 115,
            self: 10,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 30,
                  self: 21,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 32,
                  self: 25,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            }
          ],
          [
            {  // *, 1.
              title: [undefined, '1'],
              values: [
                {
                  total: 15,
                  self: 3,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // *, 2.
              title: [undefined, '2'],
              values: [
                {
                  total: 41,
                  self: 40,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 115,
            self: 10,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 30,
                  self: 21,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 32,
                  self: 25,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                []
              ]
            }
          ],
          [
            {  // *, 1.
              title: [undefined, '1'],
              values: [
                {
                  total: 15,
                  self: 3,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // *, 2.
              title: [undefined, '2'],
              values: [
                {
                  total: 41,
                  self: 40,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 115,
            self: 10,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 30,
                  self: 21,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 32,
                  self: 25,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                []
              ]
            }
          ],
          [
            {  // *, 1.
              title: [undefined, '1'],
              values: [
                {
                  total: 15,
                  self: 3,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // *, 2.
              title: [undefined, '2'],
              values: [
                {
                  total: 41,
                  self: 40,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                []
              ]
            }
          ]
        ]
      });

  // See tracing/tracing/base/multi_dimensional_view.html
  // (MultiDimensionalViewNode documentation).
  builderTest('twoDimensions_documentationExample1', 2 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['A', 'B'], ['T1', 'T2']], values: [1], kind: TOTAL },
        { path: [['A', 'B'], ['T1']], values: [2], kind: TOTAL },
        { path: [['A', 'B'], []], values: [4], kind: TOTAL },
        { path: [['A'], ['T1', 'T2']], values: [10], kind: TOTAL },
        { path: [['A'], ['T1']], values: [20], kind: TOTAL },
        { path: [['A'], []], values: [40], kind: TOTAL },
        { path: [[], ['T1', 'T2']], values: [100], kind: TOTAL },
        { path: [[], ['T1']], values: [200], kind: TOTAL },
        { path: [[], []], values: [400], kind: TOTAL }
      ],
      {  // Top-down tree view.
        title: [undefined, undefined],
        values: [
          {
            total: 400,
            self: 0,
            totalState: EXACT
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 40,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                [
                  {  // A -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 4,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // A -> B, T1.
                          id: '#0',
                          title: ['B', 'T1'],
                          values: [
                            {
                              total: 2,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B, T1 -> T2.
                                id: '#1',
                                title: ['B', 'T2'],
                                values: [
                                  {
                                    total: 1,
                                    self: 0,
                                    totalState: EXACT
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, T1.
                    id: '#2',
                    title: ['A', 'T1'],
                    values: [
                      {
                        total: 20,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [
                        '#0'  // A -> B, T1.
                      ],
                      [
                        {  // A, T1 -> T2.
                          id: '#3',
                          title: ['A', 'T2'],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [
                              '#1'  // A -> B, T1 -> T2.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, T1.
              title: [undefined, 'T1'],
              values: [
                {
                  total: 200,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                [
                  '#2'  // A, T1.
                ],
                [
                  {  // *, T1 -> T2.
                    title: [undefined, 'T2'],
                    values: [
                      {
                        total: 100,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [
                        '#3'  // A, T1 -> T2.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 400,
            self: 0,
            totalState: EXACT
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 40,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 4,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // A -> B, T1.
                          id: '#0',
                          title: ['B', 'T1'],
                          values: [
                            {
                              total: 2,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B, T1 -> T2.
                                id: '#1',
                                title: ['B', 'T2'],
                                values: [
                                  {
                                    total: 1,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A -> B, T2.
                          id: '#2',
                          title: ['B', 'T2'],
                          values: [
                            {
                              total: 1,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, T1.
                    id: '#3',
                    title: ['A', 'T1'],
                    values: [
                      {
                        total: 20,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#0'  // A -> B, T1.
                      ],
                      [
                        {  // A, T1 -> T2.
                          id: '#4',
                          title: ['A', 'T2'],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#1'  // A -> B, T1 -> T2.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A, T2.
                    id: '#5',
                    title: ['A', 'T2'],
                    values: [
                      {
                        total: 10,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#2'  // A -> B, T2.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 4,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // B, T1.
                    id: '#6',
                    title: ['B', 'T1'],
                    values: [
                      {
                        total: 2,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B, T1 -> T2.
                          id: '#7',
                          title: ['B', 'T2'],
                          values: [
                            {
                              total: 1,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B, T2.
                    id: '#8',
                    title: ['B', 'T2'],
                    values: [
                      {
                        total: 1,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, T1.
              title: [undefined, 'T1'],
              values: [
                {
                  total: 200,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#3',  // A, T1.
                  '#6'  // B, T1.
                ],
                [
                  {  // *, T1 -> T2.
                    title: [undefined, 'T2'],
                    values: [
                      {
                        total: 100,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#4',  // A, T1 -> T2.
                        '#7'  // B, T1 -> T2.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // *, T2.
              title: [undefined, 'T2'],
              values: [
                {
                  total: 100,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#5',  // A, T2.
                  '#8'  // B, T2.
                ],
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 400,
            self: 0,
            totalState: EXACT
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 40,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // A, T1.
                    id: '#0',
                    title: ['A', 'T1'],
                    values: [
                      {
                        total: 20,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // A, T2.
                    id: '#1',
                    title: ['A', 'T2'],
                    values: [
                      {
                        total: 10,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // A, T2 -> T1.
                          id: '#2',
                          title: ['A', 'T1'],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 4,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A, *.
                    title: ['A', undefined],
                    values: [
                      {
                        total: 4,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B -> A, T1.
                          id: '#3',
                          title: ['A', 'T1'],
                          values: [
                            {
                              total: 2,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // B -> A, T2.
                          id: '#4',
                          title: ['A', 'T2'],
                          values: [
                            {
                              total: 1,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // B -> A, T2 -> T1.
                                id: '#5',
                                title: ['A', 'T1'],
                                values: [
                                  {
                                    total: 1,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // B, T1.
                    id: '#6',
                    title: ['B', 'T1'],
                    values: [
                      {
                        total: 2,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#3'  // B -> A, T1.
                      ],
                      []
                    ]
                  },
                  {  // B, T2.
                    id: '#7',
                    title: ['B', 'T2'],
                    values: [
                      {
                        total: 1,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#4'  // B -> A, T2.
                      ],
                      [
                        {  // B, T2 -> T1.
                          id: '#8',
                          title: ['B', 'T1'],
                          values: [
                            {
                              total: 1,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#5'  // B -> A, T2 -> T1.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, T1.
              title: [undefined, 'T1'],
              values: [
                {
                  total: 200,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#0',  // A, T1.
                  '#6'  // B, T1.
                ],
                []
              ]
            },
            {  // *, T2.
              title: [undefined, 'T2'],
              values: [
                {
                  total: 100,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#1',  // A, T2.
                  '#7'  // B, T2.
                ],
                [
                  {  // *, T2 -> T1.
                    title: [undefined, 'T1'],
                    values: [
                      {
                        total: 100,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#2',  // A, T2 -> T1.
                        '#8'  // B, T2 -> T1.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      });

  // See tracing/tracing/base/multi_dimensional_view.html
  // (MultiDimensionalViewBuilder documentation).
  builderTest('twoDimensions_documentationExample2', 2 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['Saturday'], ['Cooking']], values: [1], kind: SELF },
        { path: [['Saturday'], ['Sports', 'Football']], values: [2],
          kind: SELF },
        { path: [['Sunday'], ['Sports', 'Basketball']], values: [3],
          kind: SELF }
      ],
      {  // Top-down tree view.
        title: [undefined, undefined],
        values: [
          {
            total: 6,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // Saturday, *.
              title: ['Saturday', undefined],
              values: [
                {
                  total: 3,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // Saturday, Cooking.
                    id: '#0',
                    title: ['Saturday', 'Cooking'],
                    values: [
                      {
                        total: 1,
                        self: 1,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // Saturday, Sports.
                    id: '#1',
                    title: ['Saturday', 'Sports'],
                    values: [
                      {
                        total: 2,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // Saturday, Sports -> Football.
                          id: '#2',
                          title: ['Saturday', 'Football'],
                          values: [
                            {
                              total: 2,
                              self: 2,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // Sunday, *.
              title: ['Sunday', undefined],
              values: [
                {
                  total: 3,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // Sunday, Sports.
                    id: '#3',
                    title: ['Sunday', 'Sports'],
                    values: [
                      {
                        total: 3,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // Sunday, Sports -> Basketball.
                          id: '#4',
                          title: ['Sunday', 'Basketball'],
                          values: [
                            {
                              total: 3,
                              self: 3,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, Cooking.
              title: [undefined, 'Cooking'],
              values: [
                {
                  total: 1,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#0'  // Saturday, Cooking.
                ],
                []
              ]
            },
            {  // *, Sports.
              title: [undefined, 'Sports'],
              values: [
                {
                  total: 5,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#1',  // Saturday, Sports.
                  '#3'  // Sunday, Sports.
                ],
                [
                  {  // *, Sports -> Football.
                    title: [undefined, 'Football'],
                    values: [
                      {
                        total: 2,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#2'  // Saturday, Sports -> Football.
                      ],
                      []
                    ]
                  },
                  {  // *, Sports -> Basketball.
                    title: [undefined, 'Basketball'],
                    values: [
                      {
                        total: 3,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#4'  // Sunday, Sports -> Basketball.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 6,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // Saturday, *.
              title: ['Saturday', undefined],
              values: [
                {
                  total: 3,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // Saturday, Cooking.
                    id: '#0',
                    title: ['Saturday', 'Cooking'],
                    values: [
                      {
                        total: 1,
                        self: 1,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // Saturday, Sports.
                    id: '#1',
                    title: ['Saturday', 'Sports'],
                    values: [
                      {
                        total: 2,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // Saturday, Sports -> Football.
                          id: '#2',
                          title: ['Saturday', 'Football'],
                          values: [
                            {
                              total: 2,
                              self: 2,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // Saturday, Football.
                    id: '#3',
                    title: ['Saturday', 'Football'],
                    values: [
                      {
                        total: 2,
                        self: 2,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // Sunday, *.
              title: ['Sunday', undefined],
              values: [
                {
                  total: 3,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // Sunday, Sports.
                    id: '#4',
                    title: ['Sunday', 'Sports'],
                    values: [
                      {
                        total: 3,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // Sunday, Sports -> Basketball.
                          id: '#5',
                          title: ['Sunday', 'Basketball'],
                          values: [
                            {
                              total: 3,
                              self: 3,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // Sunday, Basketball.
                    id: '#6',
                    title: ['Sunday', 'Basketball'],
                    values: [
                      {
                        total: 3,
                        self: 3,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, Cooking.
              title: [undefined, 'Cooking'],
              values: [
                {
                  total: 1,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#0'  // Saturday, Cooking.
                ],
                []
              ]
            },
            {  // *, Sports.
              title: [undefined, 'Sports'],
              values: [
                {
                  total: 5,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#1',  // Saturday, Sports.
                  '#4'  // Sunday, Sports.
                ],
                [
                  {  // *, Sports -> Football.
                    title: [undefined, 'Football'],
                    values: [
                      {
                        total: 2,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#2'  // Saturday, Sports -> Football.
                      ],
                      []
                    ]
                  },
                  {  // *, Sports -> Basketball.
                    title: [undefined, 'Basketball'],
                    values: [
                      {
                        total: 3,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#5'  // Sunday, Sports -> Basketball.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // *, Football.
              title: [undefined, 'Football'],
              values: [
                {
                  total: 2,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#3'  // Saturday, Football.
                ],
                []
              ]
            },
            {  // *, Basketball.
              title: [undefined, 'Basketball'],
              values: [
                {
                  total: 3,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#6'  // Sunday, Basketball.
                ],
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 6,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // Saturday, *.
              title: ['Saturday', undefined],
              values: [
                {
                  total: 3,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // Saturday, Cooking.
                    id: '#0',
                    title: ['Saturday', 'Cooking'],
                    values: [
                      {
                        total: 1,
                        self: 1,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // Saturday, Sports.
                    id: '#1',
                    title: ['Saturday', 'Sports'],
                    values: [
                      {
                        total: 2,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // Saturday, Football.
                    id: '#2',
                    title: ['Saturday', 'Football'],
                    values: [
                      {
                        total: 2,
                        self: 2,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // Saturday, Football -> Sports.
                          id: '#3',
                          title: ['Saturday', 'Sports'],
                          values: [
                            {
                              total: 2,
                              self: 2,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // Sunday, *.
              title: ['Sunday', undefined],
              values: [
                {
                  total: 3,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // Sunday, Sports.
                    id: '#4',
                    title: ['Sunday', 'Sports'],
                    values: [
                      {
                        total: 3,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // Sunday, Basketball.
                    id: '#5',
                    title: ['Sunday', 'Basketball'],
                    values: [
                      {
                        total: 3,
                        self: 3,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // Sunday, Basketball -> Sports.
                          id: '#6',
                          title: ['Sunday', 'Sports'],
                          values: [
                            {
                              total: 3,
                              self: 3,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, Cooking.
              title: [undefined, 'Cooking'],
              values: [
                {
                  total: 1,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#0'  // Saturday, Cooking.
                ],
                []
              ]
            },
            {  // *, Sports.
              title: [undefined, 'Sports'],
              values: [
                {
                  total: 5,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#1',  // Saturday, Sports.
                  '#4'  // Sunday, Sports.
                ],
                []
              ]
            },
            {  // *, Football.
              title: [undefined, 'Football'],
              values: [
                {
                  total: 2,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#2'  // Saturday, Football.
                ],
                [
                  {  // *, Football -> Sports.
                    title: [undefined, 'Sports'],
                    values: [
                      {
                        total: 2,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#3'  // Saturday, Football -> Sports.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // *, Basketball.
              title: [undefined, 'Basketball'],
              values: [
                {
                  total: 3,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#5'  // Sunday, Basketball.
                ],
                [
                  {  // *, Basketball -> Sports.
                    title: [undefined, 'Sports'],
                    values: [
                      {
                        total: 3,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#6'  // Sunday, Basketball -> Sports.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      });

  // See https://goo.gl/KY7zVE.
  builderTest('twoDimensions_heapDumpExample', 2 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['BrMain', 'Init'], ['T']], values: [151], kind: TOTAL },
        { path: [['BrMain', 'Init'], ['W']], values: [83], kind: TOTAL },
        { path: [['BrMain', 'Init'], []], values: [242], kind: TOTAL },
        { path: [['BrMain', 'MsgLp'], ['T']], values: [307], kind: TOTAL },
        { path: [['BrMain', 'MsgLp'], ['V']], values: [281], kind: TOTAL },
        { path: [['BrMain', 'MsgLp'], []], values: [601], kind: TOTAL },
        { path: [['RdMain', 'RTask'], ['T']], values: [211], kind: TOTAL },
        { path: [['RdMain', 'RTask'], ['W']], values: [337], kind: TOTAL },
        { path: [['RdMain', 'RTask'], []], values: [556], kind: TOTAL },
        { path: [[], ['T']], values: [698], kind: TOTAL },
        { path: [[], ['V']], values: [340], kind: TOTAL },
        { path: [[], ['W']], values: [461], kind: TOTAL },
        { path: [[], []], values: [1538], kind: TOTAL },
        { path: [['BrMain'], ['T']], values: [465], kind: TOTAL },
        { path: [['BrMain'], ['V']], values: [297], kind: TOTAL },
        { path: [['BrMain'], ['W']], values: [96], kind: TOTAL },
        { path: [['BrMain'], []], values: [876], kind: TOTAL },
        { path: [['RdMain'], ['T']], values: [229], kind: TOTAL },
        { path: [['RdMain'], ['W']], values: [355], kind: TOTAL },
        { path: [['RdMain'], []], values: [628], kind: TOTAL }
      ],
      {  // Top-down tree view.
        title: [undefined, undefined],
        values: [
          {
            total: 1538,
            self: 0,
            totalState: EXACT
          }
        ],
        children: [
          [
            {  // BrMain, *.
              title: ['BrMain', undefined],
              values: [
                {
                  total: 876,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                [
                  {  // BrMain -> Init, *.
                    title: ['Init', undefined],
                    values: [
                      {
                        total: 242,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // BrMain -> Init, T.
                          id: '#0',
                          title: ['Init', 'T'],
                          values: [
                            {
                              total: 151,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // BrMain -> Init, W.
                          id: '#1',
                          title: ['Init', 'W'],
                          values: [
                            {
                              total: 83,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // BrMain -> MsgLp, *.
                    title: ['MsgLp', undefined],
                    values: [
                      {
                        total: 601,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // BrMain -> MsgLp, T.
                          id: '#2',
                          title: ['MsgLp', 'T'],
                          values: [
                            {
                              total: 307,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // BrMain -> MsgLp, V.
                          id: '#3',
                          title: ['MsgLp', 'V'],
                          values: [
                            {
                              total: 281,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // BrMain, T.
                    id: '#4',
                    title: ['BrMain', 'T'],
                    values: [
                      {
                        total: 465,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [
                        '#0',  // BrMain -> Init, T.
                        '#2'  // BrMain -> MsgLp, T.
                      ],
                      []
                    ]
                  },
                  {  // BrMain, V.
                    id: '#5',
                    title: ['BrMain', 'V'],
                    values: [
                      {
                        total: 297,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [
                        '#3'  // BrMain -> MsgLp, V.
                      ],
                      []
                    ]
                  },
                  {  // BrMain, W.
                    id: '#6',
                    title: ['BrMain', 'W'],
                    values: [
                      {
                        total: 96,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [
                        '#1'  // BrMain -> Init, W.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // RdMain, *.
              title: ['RdMain', undefined],
              values: [
                {
                  total: 628,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                [
                  {  // RdMain -> RTask, *.
                    title: ['RTask', undefined],
                    values: [
                      {
                        total: 556,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // RdMain -> RTask, T.
                          id: '#7',
                          title: ['RTask', 'T'],
                          values: [
                            {
                              total: 211,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // RdMain -> RTask, W.
                          id: '#8',
                          title: ['RTask', 'W'],
                          values: [
                            {
                              total: 337,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // RdMain, T.
                    id: '#9',
                    title: ['RdMain', 'T'],
                    values: [
                      {
                        total: 229,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [
                        '#7'  // RdMain -> RTask, T.
                      ],
                      []
                    ]
                  },
                  {  // RdMain, W.
                    id: '#10',
                    title: ['RdMain', 'W'],
                    values: [
                      {
                        total: 355,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [
                        '#8'  // RdMain -> RTask, W.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, T.
              title: [undefined, 'T'],
              values: [
                {
                  total: 698,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                [
                  '#4',  // BrMain, T.
                  '#9'  // RdMain, T.
                ],
                []
              ]
            },
            {  // *, V.
              title: [undefined, 'V'],
              values: [
                {
                  total: 340,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                [
                  '#5'  // BrMain, V.
                ],
                []
              ]
            },
            {  // *, W.
              title: [undefined, 'W'],
              values: [
                {
                  total: 461,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                [
                  '#6',  // BrMain, W.
                  '#10'  // RdMain, W.
                ],
                []
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 1538,
            self: 0,
            totalState: EXACT
          }
        ],
        children: [
          [
            {  // BrMain, *.
              title: ['BrMain', undefined],
              values: [
                {
                  total: 876,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // BrMain -> Init, *.
                    title: ['Init', undefined],
                    values: [
                      {
                        total: 242,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // BrMain -> Init, T.
                          id: '#0',
                          title: ['Init', 'T'],
                          values: [
                            {
                              total: 151,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // BrMain -> Init, W.
                          id: '#1',
                          title: ['Init', 'W'],
                          values: [
                            {
                              total: 83,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // BrMain -> MsgLp, *.
                    title: ['MsgLp', undefined],
                    values: [
                      {
                        total: 601,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // BrMain -> MsgLp, T.
                          id: '#2',
                          title: ['MsgLp', 'T'],
                          values: [
                            {
                              total: 307,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // BrMain -> MsgLp, V.
                          id: '#3',
                          title: ['MsgLp', 'V'],
                          values: [
                            {
                              total: 281,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // BrMain, T.
                    id: '#4',
                    title: ['BrMain', 'T'],
                    values: [
                      {
                        total: 465,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#0',  // BrMain -> Init, T.
                        '#2'  // BrMain -> MsgLp, T.
                      ],
                      []
                    ]
                  },
                  {  // BrMain, V.
                    id: '#5',
                    title: ['BrMain', 'V'],
                    values: [
                      {
                        total: 297,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#3'  // BrMain -> MsgLp, V.
                      ],
                      []
                    ]
                  },
                  {  // BrMain, W.
                    id: '#6',
                    title: ['BrMain', 'W'],
                    values: [
                      {
                        total: 96,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#1'  // BrMain -> Init, W.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // Init, *.
              title: ['Init', undefined],
              values: [
                {
                  total: 242,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // Init, T.
                    id: '#7',
                    title: ['Init', 'T'],
                    values: [
                      {
                        total: 151,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // Init, W.
                    id: '#8',
                    title: ['Init', 'W'],
                    values: [
                      {
                        total: 83,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // MsgLp, *.
              title: ['MsgLp', undefined],
              values: [
                {
                  total: 601,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // MsgLp, T.
                    id: '#9',
                    title: ['MsgLp', 'T'],
                    values: [
                      {
                        total: 307,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // MsgLp, V.
                    id: '#10',
                    title: ['MsgLp', 'V'],
                    values: [
                      {
                        total: 281,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // RdMain, *.
              title: ['RdMain', undefined],
              values: [
                {
                  total: 628,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // RdMain -> RTask, *.
                    title: ['RTask', undefined],
                    values: [
                      {
                        total: 556,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // RdMain -> RTask, T.
                          id: '#11',
                          title: ['RTask', 'T'],
                          values: [
                            {
                              total: 211,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // RdMain -> RTask, W.
                          id: '#12',
                          title: ['RTask', 'W'],
                          values: [
                            {
                              total: 337,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // RdMain, T.
                    id: '#13',
                    title: ['RdMain', 'T'],
                    values: [
                      {
                        total: 229,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#11'  // RdMain -> RTask, T.
                      ],
                      []
                    ]
                  },
                  {  // RdMain, W.
                    id: '#14',
                    title: ['RdMain', 'W'],
                    values: [
                      {
                        total: 355,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#12'  // RdMain -> RTask, W.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // RTask, *.
              title: ['RTask', undefined],
              values: [
                {
                  total: 556,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // RTask, T.
                    id: '#15',
                    title: ['RTask', 'T'],
                    values: [
                      {
                        total: 211,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // RTask, W.
                    id: '#16',
                    title: ['RTask', 'W'],
                    values: [
                      {
                        total: 337,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, T.
              title: [undefined, 'T'],
              values: [
                {
                  total: 698,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#4',  // BrMain, T.
                  '#7',  // Init, T.
                  '#9',  // MsgLp, T.
                  '#13',  // RdMain, T.
                  '#15'  // RTask, T.
                ],
                []
              ]
            },
            {  // *, V.
              title: [undefined, 'V'],
              values: [
                {
                  total: 340,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#5',  // BrMain, V.
                  '#10'  // MsgLp, V.
                ],
                []
              ]
            },
            {  // *, W.
              title: [undefined, 'W'],
              values: [
                {
                  total: 461,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#6',  // BrMain, W.
                  '#8',  // Init, W.
                  '#14',  // RdMain, W.
                  '#16'  // RTask, W.
                ],
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 1538,
            self: 0,
            totalState: EXACT
          }
        ],
        children: [
          [
            {  // BrMain, *.
              title: ['BrMain', undefined],
              values: [
                {
                  total: 876,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // BrMain, T.
                    id: '#0',
                    title: ['BrMain', 'T'],
                    values: [
                      {
                        total: 465,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // BrMain, V.
                    id: '#1',
                    title: ['BrMain', 'V'],
                    values: [
                      {
                        total: 297,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // BrMain, W.
                    id: '#2',
                    title: ['BrMain', 'W'],
                    values: [
                      {
                        total: 96,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // Init, *.
              title: ['Init', undefined],
              values: [
                {
                  total: 242,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // Init -> BrMain, *.
                    title: ['BrMain', undefined],
                    values: [
                      {
                        total: 242,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // Init -> BrMain, T.
                          id: '#3',
                          title: ['BrMain', 'T'],
                          values: [
                            {
                              total: 151,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // Init -> BrMain, W.
                          id: '#4',
                          title: ['BrMain', 'W'],
                          values: [
                            {
                              total: 83,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // Init, T.
                    id: '#5',
                    title: ['Init', 'T'],
                    values: [
                      {
                        total: 151,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#3'  // Init -> BrMain, T.
                      ],
                      []
                    ]
                  },
                  {  // Init, W.
                    id: '#6',
                    title: ['Init', 'W'],
                    values: [
                      {
                        total: 83,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#4'  // Init -> BrMain, W.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // MsgLp, *.
              title: ['MsgLp', undefined],
              values: [
                {
                  total: 601,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // MsgLp -> BrMain, *.
                    title: ['BrMain', undefined],
                    values: [
                      {
                        total: 601,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // MsgLp -> BrMain, T.
                          id: '#7',
                          title: ['BrMain', 'T'],
                          values: [
                            {
                              total: 307,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // MsgLp -> BrMain, V.
                          id: '#8',
                          title: ['BrMain', 'V'],
                          values: [
                            {
                              total: 281,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // MsgLp, T.
                    id: '#9',
                    title: ['MsgLp', 'T'],
                    values: [
                      {
                        total: 307,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#7'  // MsgLp -> BrMain, T.
                      ],
                      []
                    ]
                  },
                  {  // MsgLp, V.
                    id: '#10',
                    title: ['MsgLp', 'V'],
                    values: [
                      {
                        total: 281,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#8'  // MsgLp -> BrMain, V.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // RdMain, *.
              title: ['RdMain', undefined],
              values: [
                {
                  total: 628,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // RdMain, T.
                    id: '#11',
                    title: ['RdMain', 'T'],
                    values: [
                      {
                        total: 229,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  },
                  {  // RdMain, W.
                    id: '#12',
                    title: ['RdMain', 'W'],
                    values: [
                      {
                        total: 355,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // RTask, *.
              title: ['RTask', undefined],
              values: [
                {
                  total: 556,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // RTask -> RdMain, *.
                    title: ['RdMain', undefined],
                    values: [
                      {
                        total: 556,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // RTask -> RdMain, T.
                          id: '#13',
                          title: ['RdMain', 'T'],
                          values: [
                            {
                              total: 211,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // RTask -> RdMain, W.
                          id: '#14',
                          title: ['RdMain', 'W'],
                          values: [
                            {
                              total: 337,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // RTask, T.
                    id: '#15',
                    title: ['RTask', 'T'],
                    values: [
                      {
                        total: 211,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#13'  // RTask -> RdMain, T.
                      ],
                      []
                    ]
                  },
                  {  // RTask, W.
                    id: '#16',
                    title: ['RTask', 'W'],
                    values: [
                      {
                        total: 337,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#14'  // RTask -> RdMain, W.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, T.
              title: [undefined, 'T'],
              values: [
                {
                  total: 698,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#0',  // BrMain, T.
                  '#5',  // Init, T.
                  '#9',  // MsgLp, T.
                  '#11',  // RdMain, T.
                  '#15'  // RTask, T.
                ],
                []
              ]
            },
            {  // *, V.
              title: [undefined, 'V'],
              values: [
                {
                  total: 340,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#1',  // BrMain, V.
                  '#10'  // MsgLp, V.
                ],
                []
              ]
            },
            {  // *, W.
              title: [undefined, 'W'],
              values: [
                {
                  total: 461,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#2',  // BrMain, W.
                  '#6',  // Init, W.
                  '#12',  // RdMain, W.
                  '#16'  // RTask, W.
                ],
                []
              ]
            }
          ]
        ]
      });

  builderTest('twoDimensions_oneRecursiveDimension', 2 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['A', 'B'], []], values: [1500], kind: TOTAL },
        { path: [['A', 'B', 'A'], []], values: [200], kind: TOTAL },
        { path: [['A', 'B', 'B'], []], values: [300], kind: TOTAL },
        { path: [['A', 'B', 'C'], []], values: [700], kind: TOTAL },
        { path: [['A', 'B'], ['T1']], values: [15], kind: TOTAL },
        { path: [['A', 'B', 'A'], ['T1']], values: [2], kind: TOTAL },
        { path: [['A', 'B', 'B'], ['T1']], values: [3], kind: TOTAL },
        { path: [['A', 'B', 'C'], ['T1']], values: [7], kind: TOTAL },
        { path: [['B', 'A'], ['T1']], values: [30000], kind: TOTAL },
        { path: [['B', 'A'], []], values: [40000], kind: TOTAL }
      ],
      {  // Top-down tree view.
        title: [undefined, undefined],
        values: [
          {
            total: 41500,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 1500,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 1500,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> A, *.
                          title: ['A', undefined],
                          values: [
                            {
                              total: 200,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B -> A, T1.
                                id: '#0',
                                title: ['A', 'T1'],
                                values: [
                                  {
                                    total: 2,
                                    self: 0,
                                    totalState: EXACT
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A -> B -> B, *.
                          title: ['B', undefined],
                          values: [
                            {
                              total: 300,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B -> B, T1.
                                id: '#1',
                                title: ['B', 'T1'],
                                values: [
                                  {
                                    total: 3,
                                    self: 0,
                                    totalState: EXACT
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A -> B -> C, *.
                          title: ['C', undefined],
                          values: [
                            {
                              total: 700,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B -> C, T1.
                                id: '#2',
                                title: ['C', 'T1'],
                                values: [
                                  {
                                    total: 7,
                                    self: 0,
                                    totalState: EXACT
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A -> B, T1.
                          id: '#3',
                          title: ['B', 'T1'],
                          values: [
                            {
                              total: 15,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [
                              '#0',  // A -> B -> A, T1.
                              '#1',  // A -> B -> B, T1.
                              '#2'  // A -> B -> C, T1.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, T1.
                    id: '#4',
                    title: ['A', 'T1'],
                    values: [
                      {
                        total: 15,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#3'  // A -> B, T1.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 40000,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A, *.
                    title: ['A', undefined],
                    values: [
                      {
                        total: 40000,
                        self: 0,
                        totalState: EXACT
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B -> A, T1.
                          id: '#5',
                          title: ['A', 'T1'],
                          values: [
                            {
                              total: 30000,
                              self: 0,
                              totalState: EXACT
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // B, T1.
                    id: '#6',
                    title: ['B', 'T1'],
                    values: [
                      {
                        total: 30000,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#5'  // B -> A, T1.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, T1.
              title: [undefined, 'T1'],
              values: [
                {
                  total: 30015,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#4',  // A, T1.
                  '#6'  // B, T1.
                ],
                []
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 41500,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 41500,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 1500,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> A, *.
                          title: ['A', undefined],
                          values: [
                            {
                              total: 200,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B -> A, T1.
                                id: '#0',
                                title: ['A', 'T1'],
                                values: [
                                  {
                                    total: 2,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A -> B -> B, *.
                          title: ['B', undefined],
                          values: [
                            {
                              total: 300,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B -> B, T1.
                                id: '#1',
                                title: ['B', 'T1'],
                                values: [
                                  {
                                    total: 3,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A -> B -> C, *.
                          title: ['C', undefined],
                          values: [
                            {
                              total: 700,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B -> C, T1.
                                id: '#2',
                                title: ['C', 'T1'],
                                values: [
                                  {
                                    total: 7,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A -> B, T1.
                          id: '#3',
                          title: ['B', 'T1'],
                          values: [
                            {
                              total: 15,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#0',  // A -> B -> A, T1.
                              '#1',  // A -> B -> B, T1.
                              '#2'  // A -> B -> C, T1.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, T1.
                    id: '#4',
                    title: ['A', 'T1'],
                    values: [
                      {
                        total: 30015,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#3'  // A -> B, T1.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 41500,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A, *.
                    title: ['A', undefined],
                    values: [
                      {
                        total: 40200,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B -> A, T1.
                          id: '#5',
                          title: ['A', 'T1'],
                          values: [
                            {
                              total: 30002,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 300,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B -> B, T1.
                          id: '#6',
                          title: ['B', 'T1'],
                          values: [
                            {
                              total: 3,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B -> C, *.
                    title: ['C', undefined],
                    values: [
                      {
                        total: 700,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B -> C, T1.
                          id: '#7',
                          title: ['C', 'T1'],
                          values: [
                            {
                              total: 7,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // B, T1.
                    id: '#8',
                    title: ['B', 'T1'],
                    values: [
                      {
                        total: 30015,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#5',  // B -> A, T1.
                        '#6',  // B -> B, T1.
                        '#7'  // B -> C, T1.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // C, *.
              title: ['C', undefined],
              values: [
                {
                  total: 700,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // C, T1.
                    id: '#9',
                    title: ['C', 'T1'],
                    values: [
                      {
                        total: 7,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, T1.
              title: [undefined, 'T1'],
              values: [
                {
                  total: 30015,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#4',  // A, T1.
                  '#8',  // B, T1.
                  '#9'  // C, T1.
                ],
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 41500,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 41500,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 40200,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> A, *.
                          title: ['A', undefined],
                          values: [
                            {
                              total: 200,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B -> A, T1.
                                id: '#0',
                                title: ['A', 'T1'],
                                values: [
                                  {
                                    total: 2,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A -> B, T1.
                          id: '#1',
                          title: ['B', 'T1'],
                          values: [
                            {
                              total: 30002,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#0'  // A -> B -> A, T1.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, T1.
                    id: '#2',
                    title: ['A', 'T1'],
                    values: [
                      {
                        total: 30015,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#1'  // A -> B, T1.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 41500,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A, *.
                    title: ['A', undefined],
                    values: [
                      {
                        total: 1500,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B -> A, T1.
                          id: '#3',
                          title: ['A', 'T1'],
                          values: [
                            {
                              total: 15,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 300,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // B -> B -> A, *.
                          title: ['A', undefined],
                          values: [
                            {
                              total: 300,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // B -> B -> A, T1.
                                id: '#4',
                                title: ['A', 'T1'],
                                values: [
                                  {
                                    total: 3,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // B -> B, T1.
                          id: '#5',
                          title: ['B', 'T1'],
                          values: [
                            {
                              total: 3,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#4'  // B -> B -> A, T1.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // B, T1.
                    id: '#6',
                    title: ['B', 'T1'],
                    values: [
                      {
                        total: 30015,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#3',  // B -> A, T1.
                        '#5'  // B -> B, T1.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // C, *.
              title: ['C', undefined],
              values: [
                {
                  total: 700,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // C -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 700,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // C -> B -> A, *.
                          title: ['A', undefined],
                          values: [
                            {
                              total: 700,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // C -> B -> A, T1.
                                id: '#7',
                                title: ['A', 'T1'],
                                values: [
                                  {
                                    total: 7,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // C -> B, T1.
                          id: '#8',
                          title: ['B', 'T1'],
                          values: [
                            {
                              total: 7,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#7'  // C -> B -> A, T1.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // C, T1.
                    id: '#9',
                    title: ['C', 'T1'],
                    values: [
                      {
                        total: 7,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#8'  // C -> B, T1.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, T1.
              title: [undefined, 'T1'],
              values: [
                {
                  total: 30015,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#2',  // A, T1.
                  '#6',  // B, T1.
                  '#9'  // C, T1.
                ],
                []
              ]
            }
          ]
        ]
      });

  builderTest('twoDimensions_twoRecursiveDimensions', 2 /* dimensions */,
      1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['A', 'A', 'B'], ['1', '2', '2']], values: [10], kind: SELF },
        { path: [['A', 'A'], ['1', '2']], values: [40], kind: TOTAL },
        { path: [['A', 'B', 'B'], ['1', '1', '2']], values: [20], kind: TOTAL },
        { path: [['A', 'B'], ['1', '1']], values: [5], kind: SELF }
      ],
      {  // Top-down tree view.
        title: [undefined, undefined],
        values: [
          {
            total: 65,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 65,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> A, *.
                    title: ['A', undefined],
                    values: [
                      {
                        total: 40,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> A -> B, *.
                          title: ['B', undefined],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> A -> B, 1.
                                id: '#0',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 10,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // A -> A -> B, 1 -> 2.
                                      id: '#1',
                                      title: ['B', '2'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [
                                          {  // A -> A -> B, 1 -> 2 -> 2.
                                            id: '#2',
                                            title: ['B', '2'],
                                            values: [
                                              {
                                                total: 10,
                                                self: 10,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [],
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A -> A, 1.
                          id: '#3',
                          title: ['A', '1'],
                          values: [
                            {
                              total: 40,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#0'  // A -> A -> B, 1.
                            ],
                            [
                              {  // A -> A, 1 -> 2.
                                id: '#4',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 40,
                                    self: 0,
                                    totalState: EXACT
                                  }
                                ],
                                children: [
                                  [
                                    '#1'  // A -> A -> B, 1 -> 2.
                                  ],
                                  [
                                    {  // A -> A, 1 -> 2 -> 2.
                                      id: '#5',
                                      title: ['A', '2'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          '#2'  // A -> A -> B, 1 -> 2 -> 2.
                                        ],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 25,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> B, *.
                          title: ['B', undefined],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B -> B, 1.
                                id: '#6',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // A -> B -> B, 1 -> 1.
                                      id: '#7',
                                      title: ['B', '1'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [
                                          {  // A -> B -> B, 1 -> 1 -> 2.
                                            id: '#8',
                                            title: ['B', '2'],
                                            values: [
                                              {
                                                total: 20,
                                                self: 0,
                                                totalState: EXACT
                                              }
                                            ],
                                            children: [
                                              [],
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A -> B, 1.
                          id: '#9',
                          title: ['B', '1'],
                          values: [
                            {
                              total: 25,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#6'  // A -> B -> B, 1.
                            ],
                            [
                              {  // A -> B, 1 -> 1.
                                id: '#10',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 25,
                                    self: 5,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#7'  // A -> B -> B, 1 -> 1.
                                  ],
                                  [
                                    {  // A -> B, 1 -> 1 -> 2.
                                      id: '#11',
                                      title: ['B', '2'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          '#8'  // A -> B -> B, 1 -> 1 -> 2.
                                        ],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, 1.
                    id: '#12',
                    title: ['A', '1'],
                    values: [
                      {
                        total: 65,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#3',  // A -> A, 1.
                        '#9'  // A -> B, 1.
                      ],
                      [
                        {  // A, 1 -> 2.
                          id: '#13',
                          title: ['A', '2'],
                          values: [
                            {
                              total: 40,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#4'  // A -> A, 1 -> 2.
                            ],
                            [
                              {  // A, 1 -> 2 -> 2.
                                id: '#14',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 10,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#5'  // A -> A, 1 -> 2 -> 2.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A, 1 -> 1.
                          id: '#15',
                          title: ['A', '1'],
                          values: [
                            {
                              total: 25,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#10'  // A -> B, 1 -> 1.
                            ],
                            [
                              {  // A, 1 -> 1 -> 2.
                                id: '#16',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#11'  // A -> B, 1 -> 1 -> 2.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, 1.
              title: [undefined, '1'],
              values: [
                {
                  total: 65,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#12'  // A, 1.
                ],
                [
                  {  // *, 1 -> 2.
                    title: [undefined, '2'],
                    values: [
                      {
                        total: 40,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#13'  // A, 1 -> 2.
                      ],
                      [
                        {  // *, 1 -> 2 -> 2.
                          title: [undefined, '2'],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#14'  // A, 1 -> 2 -> 2.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // *, 1 -> 1.
                    title: [undefined, '1'],
                    values: [
                      {
                        total: 25,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#15'  // A, 1 -> 1.
                      ],
                      [
                        {  // *, 1 -> 1 -> 2.
                          title: [undefined, '2'],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#16'  // A, 1 -> 1 -> 2.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 65,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 65,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> A, *.
                    title: ['A', undefined],
                    values: [
                      {
                        total: 40,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> A -> B, *.
                          title: ['B', undefined],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> A -> B, 1.
                                id: '#0',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 10,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // A -> A -> B, 1 -> 2.
                                      id: '#1',
                                      title: ['B', '2'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [
                                          {  // A -> A -> B, 1 -> 2 -> 2.
                                            id: '#2',
                                            title: ['B', '2'],
                                            values: [
                                              {
                                                total: 10,
                                                self: 10,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [],
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // A -> A -> B, 2.
                                id: '#3',
                                title: ['B', '2'],
                                values: [
                                  {
                                    total: 10,
                                    self: 10,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // A -> A -> B, 2 -> 2.
                                      id: '#4',
                                      title: ['B', '2'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 10,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A -> A, 1.
                          id: '#5',
                          title: ['A', '1'],
                          values: [
                            {
                              total: 40,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#0'  // A -> A -> B, 1.
                            ],
                            [
                              {  // A -> A, 1 -> 2.
                                id: '#6',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 40,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#1'  // A -> A -> B, 1 -> 2.
                                  ],
                                  [
                                    {  // A -> A, 1 -> 2 -> 2.
                                      id: '#7',
                                      title: ['A', '2'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          '#2'  // A -> A -> B, 1 -> 2 -> 2.
                                        ],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A -> A, 2.
                          id: '#8',
                          title: ['A', '2'],
                          values: [
                            {
                              total: 40,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#3'  // A -> A -> B, 2.
                            ],
                            [
                              {  // A -> A, 2 -> 2.
                                id: '#9',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 10,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#4'  // A -> A -> B, 2 -> 2.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 35,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // A -> B -> B, *.
                          title: ['B', undefined],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B -> B, 1.
                                id: '#10',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // A -> B -> B, 1 -> 1.
                                      id: '#11',
                                      title: ['B', '1'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [
                                          {  // A -> B -> B, 1 -> 1 -> 2.
                                            id: '#12',
                                            title: ['B', '2'],
                                            values: [
                                              {
                                                total: 20,
                                                self: 0,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [],
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    },
                                    {  // A -> B -> B, 1 -> 2.
                                      id: '#13',
                                      title: ['B', '2'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // A -> B -> B, 2.
                                id: '#14',
                                title: ['B', '2'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A -> B, 1.
                          id: '#15',
                          title: ['B', '1'],
                          values: [
                            {
                              total: 35,
                              self: 5,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#10'  // A -> B -> B, 1.
                            ],
                            [
                              {  // A -> B, 1 -> 1.
                                id: '#16',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 25,
                                    self: 5,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#11'  // A -> B -> B, 1 -> 1.
                                  ],
                                  [
                                    {  // A -> B, 1 -> 1 -> 2.
                                      id: '#17',
                                      title: ['B', '2'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          '#12'  // A -> B -> B, 1 -> 1 -> 2.
                                        ],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // A -> B, 1 -> 2.
                                id: '#18',
                                title: ['B', '2'],
                                values: [
                                  {
                                    total: 30,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#13'  // A -> B -> B, 1 -> 2.
                                  ],
                                  [
                                    {  // A -> B, 1 -> 2 -> 2.
                                      id: '#19',
                                      title: ['B', '2'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 10,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A -> B, 2.
                          id: '#20',
                          title: ['B', '2'],
                          values: [
                            {
                              total: 30,
                              self: 10,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#14'  // A -> B -> B, 2.
                            ],
                            [
                              {  // A -> B, 2 -> 2.
                                id: '#21',
                                title: ['B', '2'],
                                values: [
                                  {
                                    total: 10,
                                    self: 10,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, 1.
                    id: '#22',
                    title: ['A', '1'],
                    values: [
                      {
                        total: 65,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#5',  // A -> A, 1.
                        '#15'  // A -> B, 1.
                      ],
                      [
                        {  // A, 1 -> 2.
                          id: '#23',
                          title: ['A', '2'],
                          values: [
                            {
                              total: 60,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#6',  // A -> A, 1 -> 2.
                              '#18'  // A -> B, 1 -> 2.
                            ],
                            [
                              {  // A, 1 -> 2 -> 2.
                                id: '#24',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 10,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#7',  // A -> A, 1 -> 2 -> 2.
                                    '#19'  // A -> B, 1 -> 2 -> 2.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A, 1 -> 1.
                          id: '#25',
                          title: ['A', '1'],
                          values: [
                            {
                              total: 25,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#16'  // A -> B, 1 -> 1.
                            ],
                            [
                              {  // A, 1 -> 1 -> 2.
                                id: '#26',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#17'  // A -> B, 1 -> 1 -> 2.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A, 2.
                    id: '#27',
                    title: ['A', '2'],
                    values: [
                      {
                        total: 60,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#8',  // A -> A, 2.
                        '#20'  // A -> B, 2.
                      ],
                      [
                        {  // A, 2 -> 2.
                          id: '#28',
                          title: ['A', '2'],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#9',  // A -> A, 2 -> 2.
                              '#21'  // A -> B, 2 -> 2.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 35,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 20,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B -> B, 1.
                          id: '#29',
                          title: ['B', '1'],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // B -> B, 1 -> 1.
                                id: '#30',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // B -> B, 1 -> 1 -> 2.
                                      id: '#31',
                                      title: ['B', '2'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // B -> B, 1 -> 2.
                                id: '#32',
                                title: ['B', '2'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // B -> B, 2.
                          id: '#33',
                          title: ['B', '2'],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // B, 1.
                    id: '#34',
                    title: ['B', '1'],
                    values: [
                      {
                        total: 35,
                        self: 5,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#29'  // B -> B, 1.
                      ],
                      [
                        {  // B, 1 -> 2.
                          id: '#35',
                          title: ['B', '2'],
                          values: [
                            {
                              total: 30,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#32'  // B -> B, 1 -> 2.
                            ],
                            [
                              {  // B, 1 -> 2 -> 2.
                                id: '#36',
                                title: ['B', '2'],
                                values: [
                                  {
                                    total: 10,
                                    self: 10,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // B, 1 -> 1.
                          id: '#37',
                          title: ['B', '1'],
                          values: [
                            {
                              total: 25,
                              self: 5,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#30'  // B -> B, 1 -> 1.
                            ],
                            [
                              {  // B, 1 -> 1 -> 2.
                                id: '#38',
                                title: ['B', '2'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#31'  // B -> B, 1 -> 1 -> 2.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B, 2.
                    id: '#39',
                    title: ['B', '2'],
                    values: [
                      {
                        total: 30,
                        self: 10,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#33'  // B -> B, 2.
                      ],
                      [
                        {  // B, 2 -> 2.
                          id: '#40',
                          title: ['B', '2'],
                          values: [
                            {
                              total: 10,
                              self: 10,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, 1.
              title: [undefined, '1'],
              values: [
                {
                  total: 65,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#22',  // A, 1.
                  '#34'  // B, 1.
                ],
                [
                  {  // *, 1 -> 2.
                    title: [undefined, '2'],
                    values: [
                      {
                        total: 60,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#23',  // A, 1 -> 2.
                        '#35'  // B, 1 -> 2.
                      ],
                      [
                        {  // *, 1 -> 2 -> 2.
                          title: [undefined, '2'],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#24',  // A, 1 -> 2 -> 2.
                              '#36'  // B, 1 -> 2 -> 2.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // *, 1 -> 1.
                    title: [undefined, '1'],
                    values: [
                      {
                        total: 25,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#25',  // A, 1 -> 1.
                        '#37'  // B, 1 -> 1.
                      ],
                      [
                        {  // *, 1 -> 1 -> 2.
                          title: [undefined, '2'],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#26',  // A, 1 -> 1 -> 2.
                              '#38'  // B, 1 -> 1 -> 2.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // *, 2.
              title: [undefined, '2'],
              values: [
                {
                  total: 60,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#27',  // A, 2.
                  '#39'  // B, 2.
                ],
                [
                  {  // *, 2 -> 2.
                    title: [undefined, '2'],
                    values: [
                      {
                        total: 10,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#28',  // A, 2 -> 2.
                        '#40'  // B, 2 -> 2.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 65,
            self: 0,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 65,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> A, *.
                    title: ['A', undefined],
                    values: [
                      {
                        total: 40,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // A -> A, 1.
                          id: '#0',
                          title: ['A', '1'],
                          values: [
                            {
                              total: 40,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        },
                        {  // A -> A, 2.
                          id: '#1',
                          title: ['A', '2'],
                          values: [
                            {
                              total: 40,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> A, 2 -> 1.
                                id: '#2',
                                title: ['A', '1'],
                                values: [
                                  {
                                    total: 40,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              },
                              {  // A -> A, 2 -> 2.
                                id: '#3',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 10,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // A -> A, 2 -> 2 -> 1.
                                      id: '#4',
                                      title: ['A', '1'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, 1.
                    id: '#5',
                    title: ['A', '1'],
                    values: [
                      {
                        total: 65,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#0'  // A -> A, 1.
                      ],
                      [
                        {  // A, 1 -> 1.
                          id: '#6',
                          title: ['A', '1'],
                          values: [
                            {
                              total: 25,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A, 2.
                    id: '#7',
                    title: ['A', '2'],
                    values: [
                      {
                        total: 60,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#1'  // A -> A, 2.
                      ],
                      [
                        {  // A, 2 -> 1.
                          id: '#8',
                          title: ['A', '1'],
                          values: [
                            {
                              total: 60,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#2'  // A -> A, 2 -> 1.
                            ],
                            [
                              {  // A, 2 -> 1 -> 1.
                                id: '#9',
                                title: ['A', '1'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A, 2 -> 2.
                          id: '#10',
                          title: ['A', '2'],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#3'  // A -> A, 2 -> 2.
                            ],
                            [
                              {  // A, 2 -> 2 -> 1.
                                id: '#11',
                                title: ['A', '1'],
                                values: [
                                  {
                                    total: 10,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#4'  // A -> A, 2 -> 2 -> 1.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 35,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A, *.
                    title: ['A', undefined],
                    values: [
                      {
                        total: 35,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // B -> A -> A, *.
                          title: ['A', undefined],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // B -> A -> A, 1.
                                id: '#12',
                                title: ['A', '1'],
                                values: [
                                  {
                                    total: 10,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              },
                              {  // B -> A -> A, 2.
                                id: '#13',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 10,
                                    self: 10,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // B -> A -> A, 2 -> 1.
                                      id: '#14',
                                      title: ['A', '1'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        []
                                      ]
                                    },
                                    {  // B -> A -> A, 2 -> 2.
                                      id: '#15',
                                      title: ['A', '2'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 10,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [
                                          {  // B -> A -> A, 2 -> 2 -> 1.
                                            id: '#16',
                                            title: ['A', '1'],
                                            values: [
                                              {
                                                total: 10,
                                                self: 10,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [],
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // B -> A, 1.
                          id: '#17',
                          title: ['A', '1'],
                          values: [
                            {
                              total: 35,
                              self: 5,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#12'  // B -> A -> A, 1.
                            ],
                            [
                              {  // B -> A, 1 -> 1.
                                id: '#18',
                                title: ['A', '1'],
                                values: [
                                  {
                                    total: 25,
                                    self: 5,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // B -> A, 2.
                          id: '#19',
                          title: ['A', '2'],
                          values: [
                            {
                              total: 30,
                              self: 10,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#13'  // B -> A -> A, 2.
                            ],
                            [
                              {  // B -> A, 2 -> 1.
                                id: '#20',
                                title: ['A', '1'],
                                values: [
                                  {
                                    total: 30,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#14'  // B -> A -> A, 2 -> 1.
                                  ],
                                  [
                                    {  // B -> A, 2 -> 1 -> 1.
                                      id: '#21',
                                      title: ['A', '1'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // B -> A, 2 -> 2.
                                id: '#22',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 10,
                                    self: 10,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#15'  // B -> A -> A, 2 -> 2.
                                  ],
                                  [
                                    {  // B -> A, 2 -> 2 -> 1.
                                      id: '#23',
                                      title: ['A', '1'],
                                      values: [
                                        {
                                          total: 10,
                                          self: 10,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          '#16'  // B -> A -> A, 2 -> 2 -> 1.
                                        ],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B -> B, *.
                    title: ['B', undefined],
                    values: [
                      {
                        total: 20,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        {  // B -> B -> A, *.
                          title: ['A', undefined],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // B -> B -> A, 1.
                                id: '#24',
                                title: ['A', '1'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // B -> B -> A, 1 -> 1.
                                      id: '#25',
                                      title: ['A', '1'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // B -> B -> A, 2.
                                id: '#26',
                                title: ['A', '2'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    {  // B -> B -> A, 2 -> 1.
                                      id: '#27',
                                      title: ['A', '1'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [
                                          {  // B -> B -> A, 2 -> 1 -> 1.
                                            id: '#28',
                                            title: ['A', '1'],
                                            values: [
                                              {
                                                total: 20,
                                                self: 0,
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [],
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // B -> B, 1.
                          id: '#29',
                          title: ['B', '1'],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#24'  // B -> B -> A, 1.
                            ],
                            [
                              {  // B -> B, 1 -> 1.
                                id: '#30',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#25'  // B -> B -> A, 1 -> 1.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // B -> B, 2.
                          id: '#31',
                          title: ['B', '2'],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#26'  // B -> B -> A, 2.
                            ],
                            [
                              {  // B -> B, 2 -> 1.
                                id: '#32',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#27'  // B -> B -> A, 2 -> 1.
                                  ],
                                  [
                                    {  // B -> B, 2 -> 1 -> 1.
                                      id: '#33',
                                      title: ['B', '1'],
                                      values: [
                                        {
                                          total: 20,
                                          self: 0,
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          '#28'  // B -> B -> A, 2 -> 1 -> 1.
                                        ],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // B, 1.
                    id: '#34',
                    title: ['B', '1'],
                    values: [
                      {
                        total: 35,
                        self: 5,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#17',  // B -> A, 1.
                        '#29'  // B -> B, 1.
                      ],
                      [
                        {  // B, 1 -> 1.
                          id: '#35',
                          title: ['B', '1'],
                          values: [
                            {
                              total: 25,
                              self: 5,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#18',  // B -> A, 1 -> 1.
                              '#30'  // B -> B, 1 -> 1.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B, 2.
                    id: '#36',
                    title: ['B', '2'],
                    values: [
                      {
                        total: 30,
                        self: 10,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#19',  // B -> A, 2.
                        '#31'  // B -> B, 2.
                      ],
                      [
                        {  // B, 2 -> 1.
                          id: '#37',
                          title: ['B', '1'],
                          values: [
                            {
                              total: 30,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#20',  // B -> A, 2 -> 1.
                              '#32'  // B -> B, 2 -> 1.
                            ],
                            [
                              {  // B, 2 -> 1 -> 1.
                                id: '#38',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 20,
                                    self: 0,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#21',  // B -> A, 2 -> 1 -> 1.
                                    '#33'  // B -> B, 2 -> 1 -> 1.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // B, 2 -> 2.
                          id: '#39',
                          title: ['B', '2'],
                          values: [
                            {
                              total: 10,
                              self: 10,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#22'  // B -> A, 2 -> 2.
                            ],
                            [
                              {  // B, 2 -> 2 -> 1.
                                id: '#40',
                                title: ['B', '1'],
                                values: [
                                  {
                                    total: 10,
                                    self: 10,
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#23'  // B -> A, 2 -> 2 -> 1.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, 1.
              title: [undefined, '1'],
              values: [
                {
                  total: 65,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#5',  // A, 1.
                  '#34'  // B, 1.
                ],
                [
                  {  // *, 1 -> 1.
                    title: [undefined, '1'],
                    values: [
                      {
                        total: 25,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#6',  // A, 1 -> 1.
                        '#35'  // B, 1 -> 1.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // *, 2.
              title: [undefined, '2'],
              values: [
                {
                  total: 60,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#7',  // A, 2.
                  '#36'  // B, 2.
                ],
                [
                  {  // *, 2 -> 1.
                    title: [undefined, '1'],
                    values: [
                      {
                        total: 60,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#8',  // A, 2 -> 1.
                        '#37'  // B, 2 -> 1.
                      ],
                      [
                        {  // *, 2 -> 1 -> 1.
                          title: [undefined, '1'],
                          values: [
                            {
                              total: 20,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#9',  // A, 2 -> 1 -> 1.
                              '#38'  // B, 2 -> 1 -> 1.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // *, 2 -> 2.
                    title: [undefined, '2'],
                    values: [
                      {
                        total: 10,
                        self: 0,
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#10',  // A, 2 -> 2.
                        '#39'  // B, 2 -> 2.
                      ],
                      [
                        {  // *, 2 -> 2 -> 1.
                          title: [undefined, '1'],
                          values: [
                            {
                              total: 10,
                              self: 0,
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#11',  // A, 2 -> 2 -> 1.
                              '#40'  // B, 2 -> 2 -> 1.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      });

  builderTest('threeDimensions', 3 /* dimensions */, 1 /* valueCount */,
      false /* setComplete */,
      [
        { path: [['A', 'B'], ['C', 'D'], ['E', 'F']], values: [b(0)],
          kind: SELF },
        { path: [['A', 'B'], ['C', 'D'], ['E']], values: [b(1)], kind: SELF },
        { path: [['A', 'B'], ['C', 'D'], []], values: [b(2)], kind: SELF },
        { path: [['A', 'B'], ['C'], ['E', 'F']], values: [b(3)], kind: SELF },
        { path: [['A', 'B'], ['C'], ['E']], values: [b(4)], kind: SELF },
        { path: [['A', 'B'], ['C'], []], values: [b(5)], kind: SELF },
        { path: [['A', 'B'], [], ['E', 'F']], values: [b(6)], kind: SELF },
        { path: [['A', 'B'], [], ['E']], values: [b(7)], kind: SELF },
        { path: [['A', 'B'], [], []], values: [b(8)], kind: SELF },

        { path: [['A'], ['C', 'D'], ['E', 'F']], values: [b(9)], kind: SELF },
        { path: [['A'], ['C', 'D'], ['E']], values: [b(10)], kind: SELF },
        { path: [['A'], ['C', 'D'], []], values: [b(11)], kind: SELF },
        { path: [['A'], ['C'], ['E', 'F']], values: [b(12)], kind: SELF },
        { path: [['A'], ['C'], ['E']], values: [b(13)], kind: SELF },
        { path: [['A'], ['C'], []], values: [b(14)], kind: SELF },
        { path: [['A'], [], ['E', 'F']], values: [b(15)], kind: SELF },
        { path: [['A'], [], ['E']], values: [b(16)], kind: SELF },
        { path: [['A'], [], []], values: [b(17)], kind: SELF },

        { path: [[], ['C', 'D'], ['E', 'F']], values: [b(18)], kind: SELF },
        { path: [[], ['C', 'D'], ['E']], values: [b(19)], kind: SELF },
        { path: [[], ['C', 'D'], []], values: [b(20)], kind: SELF },
        { path: [[], ['C'], ['E', 'F']], values: [b(21)], kind: SELF },
        { path: [[], ['C'], ['E']], values: [b(22)], kind: SELF },
        { path: [[], ['C'], []], values: [b(23)], kind: SELF },
        { path: [[], [], ['E', 'F']], values: [b(24)], kind: SELF },
        { path: [[], [], ['E']], values: [b(25)], kind: SELF },
        { path: [[], [], []], values: [b(26)], kind: SELF }
      ],
      {  // Top-down tree view.
        title: [undefined, undefined, undefined],
        values: [
          {
            total: b([0, 26]),
            self: b(26),
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *, *.
              title: ['A', undefined, undefined],
              values: [
                {
                  total: b([0, 17]),
                  self: b(17),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B, *, *.
                    title: ['B', undefined, undefined],
                    values: [
                      {
                        total: b([0, 8]),
                        self: b(8),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // A -> B, C, *.
                          id: '#0',
                          title: ['B', 'C', undefined],
                          values: [
                            {
                              total: b([0, 5]),
                              self: b(5),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B, C -> D, *.
                                id: '#1',
                                title: ['B', 'D', undefined],
                                values: [
                                  {
                                    total: b([0, 2]),
                                    self: b(2),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  [
                                    {  // A -> B, C -> D, E.
                                      id: '#2',
                                      title: ['B', 'D', 'E'],
                                      values: [
                                        {
                                          total: b(0, 1),
                                          self: b(1),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [],
                                        [
                                          {  // A -> B, C -> D, E -> F.
                                            id: '#3',
                                            title: ['B', 'D', 'F'],
                                            values: [
                                              {
                                                total: b(0),
                                                self: b(0),
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [],
                                              [],
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ],
                            [
                              {  // A -> B, C, E.
                                id: '#4',
                                title: ['B', 'C', 'E'],
                                values: [
                                  {
                                    total: b(0, 1, 3, 4),
                                    self: b(4),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#2'  // A -> B, C -> D, E.
                                  ],
                                  [
                                    {  // A -> B, C, E -> F.
                                      id: '#5',
                                      title: ['B', 'C', 'F'],
                                      values: [
                                        {
                                          total: b(0, 3),
                                          self: b(3),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [
                                          '#3'  // A -> B, C -> D, E -> F.
                                        ],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A -> B, *, E.
                          id: '#6',
                          title: ['B', undefined, 'E'],
                          values: [
                            {
                              total: b(0, 1, 3, 4, 6, 7),
                              self: b(7),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#4'  // A -> B, C, E.
                            ],
                            [
                              {  // A -> B, *, E -> F.
                                id: '#7',
                                title: ['B', undefined, 'F'],
                                values: [
                                  {
                                    total: b(0, 3, 6),
                                    self: b(6),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#5'  // A -> B, C, E -> F.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, C, *.
                    id: '#8',
                    title: ['A', 'C', undefined],
                    values: [
                      {
                        total: b([0, 5], [9, 14]),
                        self: b(14),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#0'  // A -> B, C, *.
                      ],
                      [
                        {  // A, C -> D, *.
                          id: '#9',
                          title: ['A', 'D', undefined],
                          values: [
                            {
                              total: b([0, 2], [9, 11]),
                              self: b(11),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#1'  // A -> B, C -> D, *.
                            ],
                            [],
                            [
                              {  // A, C -> D, E.
                                id: '#10',
                                title: ['A', 'D', 'E'],
                                values: [
                                  {
                                    total: b(0, 1, 9, 10),
                                    self: b(10),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#2'  // A -> B, C -> D, E.
                                  ],
                                  [],
                                  [
                                    {  // A, C -> D, E -> F.
                                      id: '#11',
                                      title: ['A', 'D', 'F'],
                                      values: [
                                        {
                                          total: b(0, 9),
                                          self: b(9),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          '#3'  // A -> B, C -> D, E -> F.
                                        ],
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A, C, E.
                          id: '#12',
                          title: ['A', 'C', 'E'],
                          values: [
                            {
                              total: b(0, 1, 3, 4, 9, 10, 12, 13),
                              self: b(13),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#4'  // A -> B, C, E.
                            ],
                            [
                              '#10'  // A, C -> D, E.
                            ],
                            [
                              {  // A, C, E -> F.
                                id: '#13',
                                title: ['A', 'C', 'F'],
                                values: [
                                  {
                                    total: b(0, 3, 9, 12),
                                    self: b(12),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#5'  // A -> B, C, E -> F.
                                  ],
                                  [
                                    '#11'  // A, C -> D, E -> F.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, *, E.
                    id: '#14',
                    title: ['A', undefined, 'E'],
                    values: [
                      {
                        total: b(0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16),
                        self: b(16),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#6'  // A -> B, *, E.
                      ],
                      [
                        '#12'  // A, C, E.
                      ],
                      [
                        {  // A, *, E -> F.
                          id: '#15',
                          title: ['A', undefined, 'F'],
                          values: [
                            {
                              total: b(0, 3, 6, 9, 12, 15),
                              self: b(15),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#7'  // A -> B, *, E -> F.
                            ],
                            [
                              '#13'  // A, C, E -> F.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, C, *.
              title: [undefined, 'C', undefined],
              values: [
                {
                  total: b([0, 5], [9, 14], [18, 23]),
                  self: b(23),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#8'  // A, C, *.
                ],
                [
                  {  // *, C -> D, *.
                    title: [undefined, 'D', undefined],
                    values: [
                      {
                        total: b([0, 2], [9, 11], [18, 20]),
                        self: b(20),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#9'  // A, C -> D, *.
                      ],
                      [],
                      [
                        {  // *, C -> D, E.
                          id: '#16',
                          title: [undefined, 'D', 'E'],
                          values: [
                            {
                              total: b(0, 1, 9, 10, 18, 19),
                              self: b(19),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#10'  // A, C -> D, E.
                            ],
                            [],
                            [
                              {  // *, C -> D, E -> F.
                                id: '#17',
                                title: [undefined, 'D', 'F'],
                                values: [
                                  {
                                    total: b(0, 9, 18),
                                    self: b(18),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#11'  // A, C -> D, E -> F.
                                  ],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // *, C, E.
                    id: '#18',
                    title: [undefined, 'C', 'E'],
                    values: [
                      {
                        total: b(0, 1, 3, 4, 9, 10, 12, 13, 18, 19, 21, 22),
                        self: b(22),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#12'  // A, C, E.
                      ],
                      [
                        '#16'  // *, C -> D, E.
                      ],
                      [
                        {  // *, C, E -> F.
                          id: '#19',
                          title: [undefined, 'C', 'F'],
                          values: [
                            {
                              total: b(0, 3, 9, 12, 18, 21),
                              self: b(21),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#13'  // A, C, E -> F.
                            ],
                            [
                              '#17'  // *, C -> D, E -> F.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, *, E.
              title: [undefined, undefined, 'E'],
              values: [
                {
                  total: b(0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16, 18, 19, 21,
                      22, 24, 25),
                  self: b(25),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#14'  // A, *, E.
                ],
                [
                  '#18'  // *, C, E.
                ],
                [
                  {  // *, *, E -> F.
                    title: [undefined, undefined, 'F'],
                    values: [
                      {
                        total: b(0, 3, 6, 9, 12, 15, 18, 21, 24),
                        self: b(24),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#15'  // A, *, E -> F.
                      ],
                      [
                        '#19'  // *, C, E -> F.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined, undefined],
        values: [
          {
            total: b([0, 26]),
            self: b(26),
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *, *.
              title: ['A', undefined, undefined],
              values: [
                {
                  total: b([0, 17]),
                  self: b(17),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // A -> B, *, *.
                    title: ['B', undefined, undefined],
                    values: [
                      {
                        total: b([0, 8]),
                        self: b(8),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // A -> B, C, *.
                          id: '#0',
                          title: ['B', 'C', undefined],
                          values: [
                            {
                              total: b([0, 5]),
                              self: b(5),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // A -> B, C -> D, *.
                                id: '#1',
                                title: ['B', 'D', undefined],
                                values: [
                                  {
                                    total: b([0, 2]),
                                    self: b(2),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  [
                                    {  // A -> B, C -> D, E.
                                      id: '#2',
                                      title: ['B', 'D', 'E'],
                                      values: [
                                        {
                                          total: b(0, 1),
                                          self: b(1),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [],
                                        [
                                          {  // A -> B, C -> D, E -> F.
                                            id: '#3',
                                            title: ['B', 'D', 'F'],
                                            values: [
                                              {
                                                total: b(0),
                                                self: b(0),
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [],
                                              [],
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    },
                                    {  // A -> B, C -> D, F.
                                      id: '#4',
                                      title: ['B', 'D', 'F'],
                                      values: [
                                        {
                                          total: b(0),
                                          self: b(0),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ],
                            [
                              {  // A -> B, C, E.
                                id: '#5',
                                title: ['B', 'C', 'E'],
                                values: [
                                  {
                                    total: b(0, 1, 3, 4),
                                    self: b(4),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#2'  // A -> B, C -> D, E.
                                  ],
                                  [
                                    {  // A -> B, C, E -> F.
                                      id: '#6',
                                      title: ['B', 'C', 'F'],
                                      values: [
                                        {
                                          total: b(0, 3),
                                          self: b(3),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [
                                          '#3'  // A -> B, C -> D, E -> F.
                                        ],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // A -> B, C, F.
                                id: '#7',
                                title: ['B', 'C', 'F'],
                                values: [
                                  {
                                    total: b(0, 3),
                                    self: b(3),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#4'  // A -> B, C -> D, F.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A -> B, D, *.
                          id: '#8',
                          title: ['B', 'D', undefined],
                          values: [
                            {
                              total: b([0, 2]),
                              self: b(2),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [],
                            [
                              {  // A -> B, D, E.
                                id: '#9',
                                title: ['B', 'D', 'E'],
                                values: [
                                  {
                                    total: b(0, 1),
                                    self: b(1),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  [
                                    {  // A -> B, D, E -> F.
                                      id: '#10',
                                      title: ['B', 'D', 'F'],
                                      values: [
                                        {
                                          total: b(0),
                                          self: b(0),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // A -> B, D, F.
                                id: '#11',
                                title: ['B', 'D', 'F'],
                                values: [
                                  {
                                    total: b(0),
                                    self: b(0),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A -> B, *, E.
                          id: '#12',
                          title: ['B', undefined, 'E'],
                          values: [
                            {
                              total: b(0, 1, 3, 4, 6, 7),
                              self: b(7),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#5',  // A -> B, C, E.
                              '#9'  // A -> B, D, E.
                            ],
                            [
                              {  // A -> B, *, E -> F.
                                id: '#13',
                                title: ['B', undefined, 'F'],
                                values: [
                                  {
                                    total: b(0, 3, 6),
                                    self: b(6),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#6',  // A -> B, C, E -> F.
                                    '#10'  // A -> B, D, E -> F.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A -> B, *, F.
                          id: '#14',
                          title: ['B', undefined, 'F'],
                          values: [
                            {
                              total: b(0, 3, 6),
                              self: b(6),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#7',  // A -> B, C, F.
                              '#11'  // A -> B, D, F.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, C, *.
                    id: '#15',
                    title: ['A', 'C', undefined],
                    values: [
                      {
                        total: b([0, 5], [9, 14]),
                        self: b(14),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#0'  // A -> B, C, *.
                      ],
                      [
                        {  // A, C -> D, *.
                          id: '#16',
                          title: ['A', 'D', undefined],
                          values: [
                            {
                              total: b([0, 2], [9, 11]),
                              self: b(11),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#1'  // A -> B, C -> D, *.
                            ],
                            [],
                            [
                              {  // A, C -> D, E.
                                id: '#17',
                                title: ['A', 'D', 'E'],
                                values: [
                                  {
                                    total: b(0, 1, 9, 10),
                                    self: b(10),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#2'  // A -> B, C -> D, E.
                                  ],
                                  [],
                                  [
                                    {  // A, C -> D, E -> F.
                                      id: '#18',
                                      title: ['A', 'D', 'F'],
                                      values: [
                                        {
                                          total: b(0, 9),
                                          self: b(9),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          '#3'  // A -> B, C -> D, E -> F.
                                        ],
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // A, C -> D, F.
                                id: '#19',
                                title: ['A', 'D', 'F'],
                                values: [
                                  {
                                    total: b(0, 9),
                                    self: b(9),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#4'  // A -> B, C -> D, F.
                                  ],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A, C, E.
                          id: '#20',
                          title: ['A', 'C', 'E'],
                          values: [
                            {
                              total: b(0, 1, 3, 4, 9, 10, 12, 13),
                              self: b(13),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#5'  // A -> B, C, E.
                            ],
                            [
                              '#17'  // A, C -> D, E.
                            ],
                            [
                              {  // A, C, E -> F.
                                id: '#21',
                                title: ['A', 'C', 'F'],
                                values: [
                                  {
                                    total: b(0, 3, 9, 12),
                                    self: b(12),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#6'  // A -> B, C, E -> F.
                                  ],
                                  [
                                    '#18'  // A, C -> D, E -> F.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A, C, F.
                          id: '#22',
                          title: ['A', 'C', 'F'],
                          values: [
                            {
                              total: b(0, 3, 9, 12),
                              self: b(12),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#7'  // A -> B, C, F.
                            ],
                            [
                              '#19'  // A, C -> D, F.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A, D, *.
                    id: '#23',
                    title: ['A', 'D', undefined],
                    values: [
                      {
                        total: b([0, 2], [9, 11]),
                        self: b(11),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#8'  // A -> B, D, *.
                      ],
                      [],
                      [
                        {  // A, D, E.
                          id: '#24',
                          title: ['A', 'D', 'E'],
                          values: [
                            {
                              total: b(0, 1, 9, 10),
                              self: b(10),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#9'  // A -> B, D, E.
                            ],
                            [],
                            [
                              {  // A, D, E -> F.
                                id: '#25',
                                title: ['A', 'D', 'F'],
                                values: [
                                  {
                                    total: b(0, 9),
                                    self: b(9),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#10'  // A -> B, D, E -> F.
                                  ],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // A, D, F.
                          id: '#26',
                          title: ['A', 'D', 'F'],
                          values: [
                            {
                              total: b(0, 9),
                              self: b(9),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#11'  // A -> B, D, F.
                            ],
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, *, E.
                    id: '#27',
                    title: ['A', undefined, 'E'],
                    values: [
                      {
                        total: b(0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16),
                        self: b(16),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#12'  // A -> B, *, E.
                      ],
                      [
                        '#20',  // A, C, E.
                        '#24'  // A, D, E.
                      ],
                      [
                        {  // A, *, E -> F.
                          id: '#28',
                          title: ['A', undefined, 'F'],
                          values: [
                            {
                              total: b(0, 3, 6, 9, 12, 15),
                              self: b(15),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#13'  // A -> B, *, E -> F.
                            ],
                            [
                              '#21',  // A, C, E -> F.
                              '#25'  // A, D, E -> F.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A, *, F.
                    id: '#29',
                    title: ['A', undefined, 'F'],
                    values: [
                      {
                        total: b(0, 3, 6, 9, 12, 15),
                        self: b(15),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#14'  // A -> B, *, F.
                      ],
                      [
                        '#22',  // A, C, F.
                        '#26'  // A, D, F.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // B, *, *.
              title: ['B', undefined, undefined],
              values: [
                {
                  total: b([0, 8]),
                  self: b(8),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // B, C, *.
                    id: '#30',
                    title: ['B', 'C', undefined],
                    values: [
                      {
                        total: b([0, 5]),
                        self: b(5),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B, C -> D, *.
                          id: '#31',
                          title: ['B', 'D', undefined],
                          values: [
                            {
                              total: b([0, 2]),
                              self: b(2),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [],
                            [
                              {  // B, C -> D, E.
                                id: '#32',
                                title: ['B', 'D', 'E'],
                                values: [
                                  {
                                    total: b(0, 1),
                                    self: b(1),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  [
                                    {  // B, C -> D, E -> F.
                                      id: '#33',
                                      title: ['B', 'D', 'F'],
                                      values: [
                                        {
                                          total: b(0),
                                          self: b(0),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              },
                              {  // B, C -> D, F.
                                id: '#34',
                                title: ['B', 'D', 'F'],
                                values: [
                                  {
                                    total: b(0),
                                    self: b(0),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // B, C, E.
                          id: '#35',
                          title: ['B', 'C', 'E'],
                          values: [
                            {
                              total: b(0, 1, 3, 4),
                              self: b(4),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#32'  // B, C -> D, E.
                            ],
                            [
                              {  // B, C, E -> F.
                                id: '#36',
                                title: ['B', 'C', 'F'],
                                values: [
                                  {
                                    total: b(0, 3),
                                    self: b(3),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#33'  // B, C -> D, E -> F.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // B, C, F.
                          id: '#37',
                          title: ['B', 'C', 'F'],
                          values: [
                            {
                              total: b(0, 3),
                              self: b(3),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#34'  // B, C -> D, F.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B, D, *.
                    id: '#38',
                    title: ['B', 'D', undefined],
                    values: [
                      {
                        total: b([0, 2]),
                        self: b(2),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [],
                      [
                        {  // B, D, E.
                          id: '#39',
                          title: ['B', 'D', 'E'],
                          values: [
                            {
                              total: b(0, 1),
                              self: b(1),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [],
                            [
                              {  // B, D, E -> F.
                                id: '#40',
                                title: ['B', 'D', 'F'],
                                values: [
                                  {
                                    total: b(0),
                                    self: b(0),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // B, D, F.
                          id: '#41',
                          title: ['B', 'D', 'F'],
                          values: [
                            {
                              total: b(0),
                              self: b(0),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // B, *, E.
                    id: '#42',
                    title: ['B', undefined, 'E'],
                    values: [
                      {
                        total: b(0, 1, 3, 4, 6, 7),
                        self: b(7),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        '#35',  // B, C, E.
                        '#39'  // B, D, E.
                      ],
                      [
                        {  // B, *, E -> F.
                          id: '#43',
                          title: ['B', undefined, 'F'],
                          values: [
                            {
                              total: b(0, 3, 6),
                              self: b(6),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#36',  // B, C, E -> F.
                              '#40'  // B, D, E -> F.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B, *, F.
                    id: '#44',
                    title: ['B', undefined, 'F'],
                    values: [
                      {
                        total: b(0, 3, 6),
                        self: b(6),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        '#37',  // B, C, F.
                        '#41'  // B, D, F.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, C, *.
              title: [undefined, 'C', undefined],
              values: [
                {
                  total: b([0, 5], [9, 14], [18, 23]),
                  self: b(23),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#15',  // A, C, *.
                  '#30'  // B, C, *.
                ],
                [
                  {  // *, C -> D, *.
                    title: [undefined, 'D', undefined],
                    values: [
                      {
                        total: b([0, 2], [9, 11], [18, 20]),
                        self: b(20),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#16',  // A, C -> D, *.
                        '#31'  // B, C -> D, *.
                      ],
                      [],
                      [
                        {  // *, C -> D, E.
                          id: '#45',
                          title: [undefined, 'D', 'E'],
                          values: [
                            {
                              total: b(0, 1, 9, 10, 18, 19),
                              self: b(19),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#17',  // A, C -> D, E.
                              '#32'  // B, C -> D, E.
                            ],
                            [],
                            [
                              {  // *, C -> D, E -> F.
                                id: '#46',
                                title: [undefined, 'D', 'F'],
                                values: [
                                  {
                                    total: b(0, 9, 18),
                                    self: b(18),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#18',  // A, C -> D, E -> F.
                                    '#33'  // B, C -> D, E -> F.
                                  ],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        },
                        {  // *, C -> D, F.
                          id: '#47',
                          title: [undefined, 'D', 'F'],
                          values: [
                            {
                              total: b(0, 9, 18),
                              self: b(18),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#19',  // A, C -> D, F.
                              '#34'  // B, C -> D, F.
                            ],
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // *, C, E.
                    id: '#48',
                    title: [undefined, 'C', 'E'],
                    values: [
                      {
                        total: b(0, 1, 3, 4, 9, 10, 12, 13, 18, 19, 21, 22),
                        self: b(22),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#20',  // A, C, E.
                        '#35'  // B, C, E.
                      ],
                      [
                        '#45'  // *, C -> D, E.
                      ],
                      [
                        {  // *, C, E -> F.
                          id: '#49',
                          title: [undefined, 'C', 'F'],
                          values: [
                            {
                              total: b(0, 3, 9, 12, 18, 21),
                              self: b(21),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#21',  // A, C, E -> F.
                              '#36'  // B, C, E -> F.
                            ],
                            [
                              '#46'  // *, C -> D, E -> F.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // *, C, F.
                    id: '#50',
                    title: [undefined, 'C', 'F'],
                    values: [
                      {
                        total: b(0, 3, 9, 12, 18, 21),
                        self: b(21),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#22',  // A, C, F.
                        '#37'  // B, C, F.
                      ],
                      [
                        '#47'  // *, C -> D, F.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // *, D, *.
              title: [undefined, 'D', undefined],
              values: [
                {
                  total: b([0, 2], [9, 11], [18, 20]),
                  self: b(20),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#23',  // A, D, *.
                  '#38'  // B, D, *.
                ],
                [],
                [
                  {  // *, D, E.
                    id: '#51',
                    title: [undefined, 'D', 'E'],
                    values: [
                      {
                        total: b(0, 1, 9, 10, 18, 19),
                        self: b(19),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#24',  // A, D, E.
                        '#39'  // B, D, E.
                      ],
                      [],
                      [
                        {  // *, D, E -> F.
                          id: '#52',
                          title: [undefined, 'D', 'F'],
                          values: [
                            {
                              total: b(0, 9, 18),
                              self: b(18),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#25',  // A, D, E -> F.
                              '#40'  // B, D, E -> F.
                            ],
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  },
                  {  // *, D, F.
                    id: '#53',
                    title: [undefined, 'D', 'F'],
                    values: [
                      {
                        total: b(0, 9, 18),
                        self: b(18),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#26',  // A, D, F.
                        '#41'  // B, D, F.
                      ],
                      [],
                      []
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, *, E.
              title: [undefined, undefined, 'E'],
              values: [
                {
                  total: b(0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16, 18, 19, 21,
                      22, 24, 25),
                  self: b(25),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#27',  // A, *, E.
                  '#42'  // B, *, E.
                ],
                [
                  '#48',  // *, C, E.
                  '#51'  // *, D, E.
                ],
                [
                  {  // *, *, E -> F.
                    title: [undefined, undefined, 'F'],
                    values: [
                      {
                        total: b(0, 3, 6, 9, 12, 15, 18, 21, 24),
                        self: b(24),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#28',  // A, *, E -> F.
                        '#43'  // B, *, E -> F.
                      ],
                      [
                        '#49',  // *, C, E -> F.
                        '#52'  // *, D, E -> F.
                      ],
                      []
                    ]
                  }
                ]
              ]
            },
            {  // *, *, F.
              title: [undefined, undefined, 'F'],
              values: [
                {
                  total: b(0, 3, 6, 9, 12, 15, 18, 21, 24),
                  self: b(24),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#29',  // A, *, F.
                  '#44'  // B, *, F.
                ],
                [
                  '#50',  // *, C, F.
                  '#53'  // *, D, F.
                ],
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined, undefined],
        values: [
          {
            total: b([0, 26]),
            self: b(26),
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *, *.
              title: ['A', undefined, undefined],
              values: [
                {
                  total: b([0, 17]),
                  self: b(17),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [
                  {  // A, C, *.
                    id: '#0',
                    title: ['A', 'C', undefined],
                    values: [
                      {
                        total: b([0, 5], [9, 14]),
                        self: b(14),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [],
                      [
                        {  // A, C, E.
                          id: '#1',
                          title: ['A', 'C', 'E'],
                          values: [
                            {
                              total: b(0, 1, 3, 4, 9, 10, 12, 13),
                              self: b(13),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [],
                            []
                          ]
                        },
                        {  // A, C, F.
                          id: '#2',
                          title: ['A', 'C', 'F'],
                          values: [
                            {
                              total: b(0, 3, 9, 12),
                              self: b(12),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [],
                            [
                              {  // A, C, F -> E.
                                id: '#3',
                                title: ['A', 'C', 'E'],
                                values: [
                                  {
                                    total: b(0, 3, 9, 12),
                                    self: b(12),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // A, D, *.
                    id: '#4',
                    title: ['A', 'D', undefined],
                    values: [
                      {
                        total: b([0, 2], [9, 11]),
                        self: b(11),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // A, D -> C, *.
                          id: '#5',
                          title: ['A', 'C', undefined],
                          values: [
                            {
                              total: b([0, 2], [9, 11]),
                              self: b(11),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [],
                            [
                              {  // A, D -> C, E.
                                id: '#6',
                                title: ['A', 'C', 'E'],
                                values: [
                                  {
                                    total: b(0, 1, 9, 10),
                                    self: b(10),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  []
                                ]
                              },
                              {  // A, D -> C, F.
                                id: '#7',
                                title: ['A', 'C', 'F'],
                                values: [
                                  {
                                    total: b(0, 9),
                                    self: b(9),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  [
                                    {  // A, D -> C, F -> E.
                                      id: '#8',
                                      title: ['A', 'C', 'E'],
                                      values: [
                                        {
                                          total: b(0, 9),
                                          self: b(9),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // A, D, E.
                          id: '#9',
                          title: ['A', 'D', 'E'],
                          values: [
                            {
                              total: b(0, 1, 9, 10),
                              self: b(10),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#6'  // A, D -> C, E.
                            ],
                            []
                          ]
                        },
                        {  // A, D, F.
                          id: '#10',
                          title: ['A', 'D', 'F'],
                          values: [
                            {
                              total: b(0, 9),
                              self: b(9),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#7'  // A, D -> C, F.
                            ],
                            [
                              {  // A, D, F -> E.
                                id: '#11',
                                title: ['A', 'D', 'E'],
                                values: [
                                  {
                                    total: b(0, 9),
                                    self: b(9),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#8'  // A, D -> C, F -> E.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // A, *, E.
                    id: '#12',
                    title: ['A', undefined, 'E'],
                    values: [
                      {
                        total: b(0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16),
                        self: b(16),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        '#1',  // A, C, E.
                        '#9'  // A, D, E.
                      ],
                      []
                    ]
                  },
                  {  // A, *, F.
                    id: '#13',
                    title: ['A', undefined, 'F'],
                    values: [
                      {
                        total: b(0, 3, 6, 9, 12, 15),
                        self: b(15),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        '#2',  // A, C, F.
                        '#10'  // A, D, F.
                      ],
                      [
                        {  // A, *, F -> E.
                          id: '#14',
                          title: ['A', undefined, 'E'],
                          values: [
                            {
                              total: b(0, 3, 6, 9, 12, 15),
                              self: b(15),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#3',  // A, C, F -> E.
                              '#11'  // A, D, F -> E.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // B, *, *.
              title: ['B', undefined, undefined],
              values: [
                {
                  total: b([0, 8]),
                  self: b(8),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  {  // B -> A, *, *.
                    title: ['A', undefined, undefined],
                    values: [
                      {
                        total: b([0, 8]),
                        self: b(8),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [],
                      [
                        {  // B -> A, C, *.
                          id: '#15',
                          title: ['A', 'C', undefined],
                          values: [
                            {
                              total: b([0, 5]),
                              self: b(5),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [],
                            [
                              {  // B -> A, C, E.
                                id: '#16',
                                title: ['A', 'C', 'E'],
                                values: [
                                  {
                                    total: b(0, 1, 3, 4),
                                    self: b(4),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  []
                                ]
                              },
                              {  // B -> A, C, F.
                                id: '#17',
                                title: ['A', 'C', 'F'],
                                values: [
                                  {
                                    total: b(0, 3),
                                    self: b(3),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  [
                                    {  // B -> A, C, F -> E.
                                      id: '#18',
                                      title: ['A', 'C', 'E'],
                                      values: [
                                        {
                                          total: b(0, 3),
                                          self: b(3),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        },
                        {  // B -> A, D, *.
                          id: '#19',
                          title: ['A', 'D', undefined],
                          values: [
                            {
                              total: b([0, 2]),
                              self: b(2),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              {  // B -> A, D -> C, *.
                                id: '#20',
                                title: ['A', 'C', undefined],
                                values: [
                                  {
                                    total: b([0, 2]),
                                    self: b(2),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [],
                                  [
                                    {  // B -> A, D -> C, E.
                                      id: '#21',
                                      title: ['A', 'C', 'E'],
                                      values: [
                                        {
                                          total: b(0, 1),
                                          self: b(1),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [],
                                        []
                                      ]
                                    },
                                    {  // B -> A, D -> C, F.
                                      id: '#22',
                                      title: ['A', 'C', 'F'],
                                      values: [
                                        {
                                          total: b(0),
                                          self: b(0),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [],
                                        [
                                          {  // B -> A, D -> C, F -> E.
                                            id: '#23',
                                            title: ['A', 'C', 'E'],
                                            values: [
                                              {
                                                total: b(0),
                                                self: b(0),
                                                totalState: LOWER_BOUND
                                              }
                                            ],
                                            children: [
                                              [],
                                              [],
                                              []
                                            ]
                                          }
                                        ]
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ],
                            [
                              {  // B -> A, D, E.
                                id: '#24',
                                title: ['A', 'D', 'E'],
                                values: [
                                  {
                                    total: b(0, 1),
                                    self: b(1),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#21'  // B -> A, D -> C, E.
                                  ],
                                  []
                                ]
                              },
                              {  // B -> A, D, F.
                                id: '#25',
                                title: ['A', 'D', 'F'],
                                values: [
                                  {
                                    total: b(0),
                                    self: b(0),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#22'  // B -> A, D -> C, F.
                                  ],
                                  [
                                    {  // B -> A, D, F -> E.
                                      id: '#26',
                                      title: ['A', 'D', 'E'],
                                      values: [
                                        {
                                          total: b(0),
                                          self: b(0),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [],
                                        [
                                          '#23'  // B -> A, D -> C, F -> E.
                                        ],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // B -> A, *, E.
                          id: '#27',
                          title: ['A', undefined, 'E'],
                          values: [
                            {
                              total: b(0, 1, 3, 4, 6, 7),
                              self: b(7),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#16',  // B -> A, C, E.
                              '#24'  // B -> A, D, E.
                            ],
                            []
                          ]
                        },
                        {  // B -> A, *, F.
                          id: '#28',
                          title: ['A', undefined, 'F'],
                          values: [
                            {
                              total: b(0, 3, 6),
                              self: b(6),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [],
                            [
                              '#17',  // B -> A, C, F.
                              '#25'  // B -> A, D, F.
                            ],
                            [
                              {  // B -> A, *, F -> E.
                                id: '#29',
                                title: ['A', undefined, 'E'],
                                values: [
                                  {
                                    total: b(0, 3, 6),
                                    self: b(6),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [],
                                  [
                                    '#18',  // B -> A, C, F -> E.
                                    '#26'  // B -> A, D, F -> E.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // B, C, *.
                    id: '#30',
                    title: ['B', 'C', undefined],
                    values: [
                      {
                        total: b([0, 5]),
                        self: b(5),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#15'  // B -> A, C, *.
                      ],
                      [],
                      [
                        {  // B, C, E.
                          id: '#31',
                          title: ['B', 'C', 'E'],
                          values: [
                            {
                              total: b(0, 1, 3, 4),
                              self: b(4),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#16'  // B -> A, C, E.
                            ],
                            [],
                            []
                          ]
                        },
                        {  // B, C, F.
                          id: '#32',
                          title: ['B', 'C', 'F'],
                          values: [
                            {
                              total: b(0, 3),
                              self: b(3),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#17'  // B -> A, C, F.
                            ],
                            [],
                            [
                              {  // B, C, F -> E.
                                id: '#33',
                                title: ['B', 'C', 'E'],
                                values: [
                                  {
                                    total: b(0, 3),
                                    self: b(3),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#18'  // B -> A, C, F -> E.
                                  ],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  },
                  {  // B, D, *.
                    id: '#34',
                    title: ['B', 'D', undefined],
                    values: [
                      {
                        total: b([0, 2]),
                        self: b(2),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#19'  // B -> A, D, *.
                      ],
                      [
                        {  // B, D -> C, *.
                          id: '#35',
                          title: ['B', 'C', undefined],
                          values: [
                            {
                              total: b([0, 2]),
                              self: b(2),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#20'  // B -> A, D -> C, *.
                            ],
                            [],
                            [
                              {  // B, D -> C, E.
                                id: '#36',
                                title: ['B', 'C', 'E'],
                                values: [
                                  {
                                    total: b(0, 1),
                                    self: b(1),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#21'  // B -> A, D -> C, E.
                                  ],
                                  [],
                                  []
                                ]
                              },
                              {  // B, D -> C, F.
                                id: '#37',
                                title: ['B', 'C', 'F'],
                                values: [
                                  {
                                    total: b(0),
                                    self: b(0),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#22'  // B -> A, D -> C, F.
                                  ],
                                  [],
                                  [
                                    {  // B, D -> C, F -> E.
                                      id: '#38',
                                      title: ['B', 'C', 'E'],
                                      values: [
                                        {
                                          total: b(0),
                                          self: b(0),
                                          totalState: LOWER_BOUND
                                        }
                                      ],
                                      children: [
                                        [
                                          '#23'  // B -> A, D -> C, F -> E.
                                        ],
                                        [],
                                        []
                                      ]
                                    }
                                  ]
                                ]
                              }
                            ]
                          ]
                        }
                      ],
                      [
                        {  // B, D, E.
                          id: '#39',
                          title: ['B', 'D', 'E'],
                          values: [
                            {
                              total: b(0, 1),
                              self: b(1),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#24'  // B -> A, D, E.
                            ],
                            [
                              '#36'  // B, D -> C, E.
                            ],
                            []
                          ]
                        },
                        {  // B, D, F.
                          id: '#40',
                          title: ['B', 'D', 'F'],
                          values: [
                            {
                              total: b(0),
                              self: b(0),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#25'  // B -> A, D, F.
                            ],
                            [
                              '#37'  // B, D -> C, F.
                            ],
                            [
                              {  // B, D, F -> E.
                                id: '#41',
                                title: ['B', 'D', 'E'],
                                values: [
                                  {
                                    total: b(0),
                                    self: b(0),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#26'  // B -> A, D, F -> E.
                                  ],
                                  [
                                    '#38'  // B, D -> C, F -> E.
                                  ],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // B, *, E.
                    id: '#42',
                    title: ['B', undefined, 'E'],
                    values: [
                      {
                        total: b(0, 1, 3, 4, 6, 7),
                        self: b(7),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#27'  // B -> A, *, E.
                      ],
                      [
                        '#31',  // B, C, E.
                        '#39'  // B, D, E.
                      ],
                      []
                    ]
                  },
                  {  // B, *, F.
                    id: '#43',
                    title: ['B', undefined, 'F'],
                    values: [
                      {
                        total: b(0, 3, 6),
                        self: b(6),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#28'  // B -> A, *, F.
                      ],
                      [
                        '#32',  // B, C, F.
                        '#40'  // B, D, F.
                      ],
                      [
                        {  // B, *, F -> E.
                          id: '#44',
                          title: ['B', undefined, 'E'],
                          values: [
                            {
                              total: b(0, 3, 6),
                              self: b(6),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#29'  // B -> A, *, F -> E.
                            ],
                            [
                              '#33',  // B, C, F -> E.
                              '#41'  // B, D, F -> E.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, C, *.
              title: [undefined, 'C', undefined],
              values: [
                {
                  total: b([0, 5], [9, 14], [18, 23]),
                  self: b(23),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#0',  // A, C, *.
                  '#30'  // B, C, *.
                ],
                [],
                [
                  {  // *, C, E.
                    id: '#45',
                    title: [undefined, 'C', 'E'],
                    values: [
                      {
                        total: b(0, 1, 3, 4, 9, 10, 12, 13, 18, 19, 21, 22),
                        self: b(22),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#1',  // A, C, E.
                        '#31'  // B, C, E.
                      ],
                      [],
                      []
                    ]
                  },
                  {  // *, C, F.
                    id: '#46',
                    title: [undefined, 'C', 'F'],
                    values: [
                      {
                        total: b(0, 3, 9, 12, 18, 21),
                        self: b(21),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#2',  // A, C, F.
                        '#32'  // B, C, F.
                      ],
                      [],
                      [
                        {  // *, C, F -> E.
                          id: '#47',
                          title: [undefined, 'C', 'E'],
                          values: [
                            {
                              total: b(0, 3, 9, 12, 18, 21),
                              self: b(21),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#3',  // A, C, F -> E.
                              '#33'  // B, C, F -> E.
                            ],
                            [],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {  // *, D, *.
              title: [undefined, 'D', undefined],
              values: [
                {
                  total: b([0, 2], [9, 11], [18, 20]),
                  self: b(20),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#4',  // A, D, *.
                  '#34'  // B, D, *.
                ],
                [
                  {  // *, D -> C, *.
                    title: [undefined, 'C', undefined],
                    values: [
                      {
                        total: b([0, 2], [9, 11], [18, 20]),
                        self: b(20),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#5',  // A, D -> C, *.
                        '#35'  // B, D -> C, *.
                      ],
                      [],
                      [
                        {  // *, D -> C, E.
                          id: '#48',
                          title: [undefined, 'C', 'E'],
                          values: [
                            {
                              total: b(0, 1, 9, 10, 18, 19),
                              self: b(19),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#6',  // A, D -> C, E.
                              '#36'  // B, D -> C, E.
                            ],
                            [],
                            []
                          ]
                        },
                        {  // *, D -> C, F.
                          id: '#49',
                          title: [undefined, 'C', 'F'],
                          values: [
                            {
                              total: b(0, 9, 18),
                              self: b(18),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#7',  // A, D -> C, F.
                              '#37'  // B, D -> C, F.
                            ],
                            [],
                            [
                              {  // *, D -> C, F -> E.
                                id: '#50',
                                title: [undefined, 'C', 'E'],
                                values: [
                                  {
                                    total: b(0, 9, 18),
                                    self: b(18),
                                    totalState: LOWER_BOUND
                                  }
                                ],
                                children: [
                                  [
                                    '#8',  // A, D -> C, F -> E.
                                    '#38'  // B, D -> C, F -> E.
                                  ],
                                  [],
                                  []
                                ]
                              }
                            ]
                          ]
                        }
                      ]
                    ]
                  }
                ],
                [
                  {  // *, D, E.
                    id: '#51',
                    title: [undefined, 'D', 'E'],
                    values: [
                      {
                        total: b(0, 1, 9, 10, 18, 19),
                        self: b(19),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#9',  // A, D, E.
                        '#39'  // B, D, E.
                      ],
                      [
                        '#48'  // *, D -> C, E.
                      ],
                      []
                    ]
                  },
                  {  // *, D, F.
                    id: '#52',
                    title: [undefined, 'D', 'F'],
                    values: [
                      {
                        total: b(0, 9, 18),
                        self: b(18),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#10',  // A, D, F.
                        '#40'  // B, D, F.
                      ],
                      [
                        '#49'  // *, D -> C, F.
                      ],
                      [
                        {  // *, D, F -> E.
                          id: '#53',
                          title: [undefined, 'D', 'E'],
                          values: [
                            {
                              total: b(0, 9, 18),
                              self: b(18),
                              totalState: LOWER_BOUND
                            }
                          ],
                          children: [
                            [
                              '#11',  // A, D, F -> E.
                              '#41'  // B, D, F -> E.
                            ],
                            [
                              '#50'  // *, D -> C, F -> E.
                            ],
                            []
                          ]
                        }
                      ]
                    ]
                  }
                ]
              ]
            }
          ],
          [
            {  // *, *, E.
              title: [undefined, undefined, 'E'],
              values: [
                {
                  total: b(0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16, 18, 19, 21,
                      22, 24, 25),
                  self: b(25),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#12',  // A, *, E.
                  '#42'  // B, *, E.
                ],
                [
                  '#45',  // *, C, E.
                  '#51'  // *, D, E.
                ],
                []
              ]
            },
            {  // *, *, F.
              title: [undefined, undefined, 'F'],
              values: [
                {
                  total: b(0, 3, 6, 9, 12, 15, 18, 21, 24),
                  self: b(24),
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [
                  '#13',  // A, *, F.
                  '#43'  // B, *, F.
                ],
                [
                  '#46',  // *, C, F.
                  '#52'  // *, D, F.
                ],
                [
                  {  // *, *, F -> E.
                    title: [undefined, undefined, 'E'],
                    values: [
                      {
                        total: b(0, 3, 6, 9, 12, 15, 18, 21, 24),
                        self: b(24),
                        totalState: LOWER_BOUND
                      }
                    ],
                    children: [
                      [
                        '#14',  // A, *, F -> E.
                        '#44'  // B, *, F -> E.
                      ],
                      [
                        '#47',  // *, C, F -> E.
                        '#53'  // *, D, F -> E.
                      ],
                      []
                    ]
                  }
                ]
              ]
            }
          ]
        ]
      });

  builderTest('twoDimensionsComplete_totalCalculation', 2 /* dimensions */,
      1 /* valueCount */,
      true /* setComplete */,
      [
        { path: [[], []], values: [10], kind: SELF },
        { path: [['A'], []], values: [21], kind: SELF },
        { path: [['A'], []], values: [30], kind: TOTAL },
        { path: [['B'], []], values: [25], kind: SELF },
        { path: [['B'], []], values: [32], kind: TOTAL },
        { path: [[], ['1']], values: [3], kind: SELF },
        { path: [[], ['1']], values: [15], kind: TOTAL },
        { path: [[], ['2']], values: [40], kind: SELF },
        { path: [[], ['2']], values: [41], kind: TOTAL }
      ],
      {  // Top-down tree view.
        title: [undefined, undefined],
        values: [
          {
            total: 115,
            self: 10,
            totalState: EXACT
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 30,
                  self: 21,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 32,
                  self: 25,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            }
          ],
          [
            {  // *, 1.
              title: [undefined, '1'],
              values: [
                {
                  total: 15,
                  self: 3,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // *, 2.
              title: [undefined, '2'],
              values: [
                {
                  total: 41,
                  self: 40,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 115,
            self: 10,
            totalState: EXACT
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 30,
                  self: 21,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 32,
                  self: 25,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            }
          ],
          [
            {  // *, 1.
              title: [undefined, '1'],
              values: [
                {
                  total: 15,
                  self: 3,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // *, 2.
              title: [undefined, '2'],
              values: [
                {
                  total: 41,
                  self: 40,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined],
        values: [
          {
            total: 115,
            self: 10,
            totalState: EXACT
          }
        ],
        children: [
          [
            {  // A, *.
              title: ['A', undefined],
              values: [
                {
                  total: 30,
                  self: 21,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // B, *.
              title: ['B', undefined],
              values: [
                {
                  total: 32,
                  self: 25,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            }
          ],
          [
            {  // *, 1.
              title: [undefined, '1'],
              values: [
                {
                  total: 15,
                  self: 3,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            },
            {  // *, 2.
              title: [undefined, '2'],
              values: [
                {
                  total: 41,
                  self: 40,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                []
              ]
            }
          ]
        ]
      });


  builderTest('threeDimensions_twoValues', 3 /* dimensions */,
      2 /* valueCount */,
      false /* setComplete */,
      [
        { path: [[], [], []], values: [1, 89], kind: SELF },
        { path: [['A'], [], []], values: [2, 34], kind: SELF },
        { path: [['A'], [], []], values: [4, 55], kind: TOTAL },
        { path: [['B'], [], []], values: [undefined, 13], kind: SELF },
        { path: [['B'], [], []], values: [16, 21], kind: TOTAL },
        { path: [[], ['1'], []], values: [32, undefined], kind: SELF },
        { path: [[], ['1'], []], values: [64, 8], kind: TOTAL },
        { path: [[], ['2'], []], values: [128, 2], kind: SELF },
        { path: [[], ['2'], []], values: [undefined, undefined], kind: TOTAL },
        { path: [[], [], ['%']], values: [undefined, 1], kind: TOTAL },
        { path: [[], [], ['$']], values: [1024, undefined], kind: TOTAL },
        { path: [[], [], ['@']], values: [undefined, undefined], kind: SELF }
      ],
      {  // Top-down tree view.
        title: [undefined, undefined, undefined],
        values: [
          {
            total: (1 + 2 + 32 + 128) /* selfSum([[], [], []], 0) */ +
                1024 /* minResidual([[], [], []], 0) */,
            self: 1,
            totalState: LOWER_BOUND
          },
          {
            total: (89 + 34 + 13 + 2) /* selfSum([[], [], []], 1) */ +
                ((55 - 34) + (21 - 13)) /* maxResidual([[], [], []], 1) */,
            self: 89,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *, *.
              title: ['A', undefined, undefined],
              values: [
                {
                  total: 4,
                  self: 2,
                  totalState: EXACT
                },
                {
                  total: 55,
                  self: 34,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // B, *, *.
              title: ['B', undefined, undefined],
              values: [
                {
                  total: 16,
                  self: 0,
                  totalState: EXACT
                },
                {
                  total: 21,
                  self: 13,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                [],
                []
              ]
            }
          ],
          [
            {  // *, 1, *.
              title: [undefined, '1', undefined],
              values: [
                {
                  total: 64,
                  self: 32,
                  totalState: EXACT
                },
                {
                  total: 8,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // *, 2, *.
              title: [undefined, '2', undefined],
              values: [
                {
                  total: 128,
                  self: 128,
                  totalState: LOWER_BOUND
                },
                {
                  total: 2,
                  self: 2,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            }
          ],
          [
            {  // *, *, %.
              title: [undefined, undefined, '%'],
              values: [
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                },
                {
                  total: 1,
                  self: 0,
                  totalState: EXACT
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // *, *, $.
              title: [undefined, undefined, '$'],
              values: [
                {
                  total: 1024,
                  self: 0,
                  totalState: EXACT
                },
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // *, *, @.
              title: [undefined, undefined, '@'],
              values: [
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                },
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                }
              ],
              children: [
                [],
                [],
                []
              ]
            }
          ]
        ]
      },
      {  // Top-down heavy view.
        title: [undefined, undefined, undefined],
        values: [
          {
            total: 1187,
            self: 1,
            totalState: LOWER_BOUND
          },
          {
            total: 167,
            self: 89,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *, *.
              title: ['A', undefined, undefined],
              values: [
                {
                  total: 4,
                  self: 2,
                  totalState: LOWER_BOUND
                },
                {
                  total: 55,
                  self: 34,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // B, *, *.
              title: ['B', undefined, undefined],
              values: [
                {
                  total: 16,
                  self: 0,
                  totalState: LOWER_BOUND
                },
                {
                  total: 21,
                  self: 13,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            }
          ],
          [
            {  // *, 1, *.
              title: [undefined, '1', undefined],
              values: [
                {
                  total: 64,
                  self: 32,
                  totalState: LOWER_BOUND
                },
                {
                  total: 8,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // *, 2, *.
              title: [undefined, '2', undefined],
              values: [
                {
                  total: 128,
                  self: 128,
                  totalState: LOWER_BOUND
                },
                {
                  total: 2,
                  self: 2,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            }
          ],
          [
            {  // *, *, %.
              title: [undefined, undefined, '%'],
              values: [
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                },
                {
                  total: 1,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // *, *, $.
              title: [undefined, undefined, '$'],
              values: [
                {
                  total: 1024,
                  self: 0,
                  totalState: LOWER_BOUND
                },
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // *, *, @.
              title: [undefined, undefined, '@'],
              values: [
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                },
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                }
              ],
              children: [
                [],
                [],
                []
              ]
            }
          ]
        ]
      },
      {  // Bottom-up heavy view.
        title: [undefined, undefined, undefined],
        values: [
          {
            total: 1187,
            self: 1,
            totalState: LOWER_BOUND
          },
          {
            total: 167,
            self: 89,
            totalState: LOWER_BOUND
          }
        ],
        children: [
          [
            {  // A, *, *.
              title: ['A', undefined, undefined],
              values: [
                {
                  total: 4,
                  self: 2,
                  totalState: LOWER_BOUND
                },
                {
                  total: 55,
                  self: 34,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // B, *, *.
              title: ['B', undefined, undefined],
              values: [
                {
                  total: 16,
                  self: 0,
                  totalState: LOWER_BOUND
                },
                {
                  total: 21,
                  self: 13,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            }
          ],
          [
            {  // *, 1, *.
              title: [undefined, '1', undefined],
              values: [
                {
                  total: 64,
                  self: 32,
                  totalState: LOWER_BOUND
                },
                {
                  total: 8,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // *, 2, *.
              title: [undefined, '2', undefined],
              values: [
                {
                  total: 128,
                  self: 128,
                  totalState: LOWER_BOUND
                },
                {
                  total: 2,
                  self: 2,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            }
          ],
          [
            {  // *, *, %.
              title: [undefined, undefined, '%'],
              values: [
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                },
                {
                  total: 1,
                  self: 0,
                  totalState: LOWER_BOUND
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // *, *, $.
              title: [undefined, undefined, '$'],
              values: [
                {
                  total: 1024,
                  self: 0,
                  totalState: LOWER_BOUND
                },
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                }
              ],
              children: [
                [],
                [],
                []
              ]
            },
            {  // *, *, @.
              title: [undefined, undefined, '@'],
              values: [
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                },
                {
                  total: 0,
                  self: 0,
                  totalState: NOT_PROVIDED
                }
              ],
              children: [
                [],
                [],
                []
              ]
            }
          ]
        ]
      });

  test('recursionDepthTracker', function() {
    const MAX_DEPTH = 5;
    const tracker = new RecursionDepthTracker(MAX_DEPTH, 2 /* dimension */);

    function pushNewNode(title) {
      const node = new MultiDimensionalViewNode(
          [undefined, 'ignored dimension', title, 'also ignored'],
          1 /* valueCount (not relevant for this test) */);
      tracker.push(node);
      return node;
    }

    function checkTracker(expectedDefinedViewNodePath, expectedRecursionDepth) {
      const expectedBottomIndex = MAX_DEPTH -
        expectedDefinedViewNodePath.length;
      assert.strictEqual(tracker.bottomIndex, expectedBottomIndex);
      assert.strictEqual(tracker.topIndex, MAX_DEPTH);

      const undefinedPadding = new Array(expectedBottomIndex);
      const expectedViewNodePath =
          undefinedPadding.concat(expectedDefinedViewNodePath);
      const expectedTitlePath =
          undefinedPadding.concat(expectedDefinedViewNodePath.map(
              function(node) { return node.title[2]; }));
      assertListStrictEqual(tracker.viewNodePath, expectedViewNodePath);
      assertListStrictEqual(tracker.titlePath, expectedTitlePath);

      assert.strictEqual(tracker.recursionDepth, expectedRecursionDepth);
    }

    checkTracker([] /* empty stack */, 0);
    const a1 = pushNewNode('A');
    checkTracker([a1], 0);
    const b1 = pushNewNode('B');
    checkTracker([b1, a1], 0);
    const c1 = pushNewNode('C');
    checkTracker([c1, b1, a1], 0);
    const d1 = pushNewNode('D');
    checkTracker([d1, c1, b1, a1], 0);
    tracker.pop();
    checkTracker([c1, b1, a1], 0);
    const a2 = pushNewNode('A');
    checkTracker([a2, c1, b1, a1], 1);
    const b2 = pushNewNode('B');
    checkTracker([b2, a2, c1, b1, a1], 2);
    tracker.pop();
    checkTracker([a2, c1, b1, a1], 1);
    tracker.pop();
    checkTracker([c1, b1, a1], 0);
    tracker.push(b2);
    checkTracker([b2, c1, b1, a1], 1);
    tracker.pop();
    checkTracker([c1, b1, a1], 0);
    tracker.pop();
    checkTracker([b1, a1], 0);
    tracker.pop();
    checkTracker([a1], 0);
    const a3 = pushNewNode('A');
    checkTracker([a3, a1], 1);
    tracker.push(a2);
    checkTracker([a2, a3, a1], 2);
    const a4 = pushNewNode('A');
    checkTracker([a4, a2, a3, a1], 3);
    tracker.pop();
    checkTracker([a2, a3, a1], 2);
    const b3 = pushNewNode('B');
    checkTracker([b3, a2, a3, a1], 0);
    tracker.push(a4);
    checkTracker([a4, b3, a2, a3, a1], 1);
    tracker.pop();
    checkTracker([b3, a2, a3, a1], 0);
    tracker.pop();
    checkTracker([a2, a3, a1], 2);
    tracker.pop();
    checkTracker([a3, a1], 1);
    tracker.pop();
    checkTracker([a1], 0);
    tracker.pop();
    checkTracker([], 0);
    tracker.push(a4);
    checkTracker([a4], 0);
    tracker.push(b1);
    checkTracker([b1, a4], 0);
    tracker.push(a1);
    checkTracker([a1, b1, a4], 1);
    tracker.pop();
    checkTracker([b1, a4], 0);
    const c2 = pushNewNode('C');
    checkTracker([c2, b1, a4], 0);
    tracker.push(a3);
    checkTracker([a3, c2, b1, a4], 1);
    tracker.pop();
    checkTracker([c2, b1, a4], 0);
    tracker.pop();
    checkTracker([b1, a4], 0);
    tracker.pop();
    checkTracker([a4], 0);
    tracker.pop();
    checkTracker([], 0);

    assert.throws(function() {
      // Try popping from an empty tracker.
      tracker.pop();
    });

    pushNewNode('F');
    pushNewNode('U');
    pushNewNode('L');
    pushNewNode('L');
    pushNewNode('!');
    assert.throws(function() {
      // Try pushing to a full tracker.
      pushNewNode(':-(');
    });
  });

  test('zFunction', function() {
    // Empty list/string (suffix).
    assert.deepEqual(zFunction([], 0), []);
    assert.deepEqual(zFunction(['A'], 1), []);
    assert.deepEqual(zFunction(['A', 'B', 'C'], 3), []);
    assert.deepEqual(zFunction('', 0), []);
    assert.deepEqual(zFunction('A', 1), []);
    assert.deepEqual(zFunction('ABC', 3), []);

    // Singleton list/string.
    checkZFunction([1], [0]);
    checkZFunction('T', [0]);

    // No duplicate elements.
    checkZFunction([1, 2, 3, 4, 5], [0, 0, 0, 0, 0]);
    checkZFunction('ABCDEF', [0, 0, 0, 0, 0, 0]);

    // No substring is a suffix.
    checkZFunction([1, 2, 3, 2], [0, 0, 0, 0]);
    checkZFunction('ABBB', [0, 0, 0, 0]);

    // Pure repetition.
    checkZFunction([1, 1, 1, 1, 1], [0, 4, 3, 2, 1]);
    checkZFunction('AAAAA', [0, 4, 3, 2, 1]);

    // Interleaved repetition.
    checkZFunction([1, 2, 1, 3, 1, 2, 1], [0, 0, 1, 0, 3, 0, 1]);
    checkZFunction('AAABAAB', [0, 2, 1, 0, 2, 1, 0]);

    // Complex patterns.
    checkZFunction([7, 9, 7, 9, 7, 9, 7, 9], [0, 0, 6, 0, 4, 0, 2, 0]);
    checkZFunction('CCGTCCCGTACC', [0, 1, 0, 0, 2, 4, 1, 0, 0, 0, 2, 1]);
  });
});
</script>
